Paddle Connect

If you’re building an application ontop of Paddle, or that requires a developer to authenticate with their Paddle account, the recommended way of doing this is using Paddle Connect, our simple authentication system.

Intro

The documentation below assumes you are creating a web-based application using Paddle connect, if you require other native ways to authenticate with Paddle, these are available. Please contact support for documentation, and to have this enabled on your account.

The Authentication Flow

Authentication with Paddle is a simple 3-step process, this is illustrated below for clarity:

  • User clicks a ‘Login with Paddle’ or ‘Connect Your Paddle Account’ button/ link within your application.
  • Your application pops a window over the page, which asks a user to login to their Paddle account, and approve your application for access.
  • Upon completion, the popup is closed and a notification is sent to your page containing a Authentication Token for that user. This token can then be used to make requests to the Paddle API.

Authenticating a User

Generating the Auth URL

The first step is to build the authentication URL for your application, the page for authentication is: https://vendors.paddle.com/vendor/external/integrate

The integration URL accepts three parameters, sent as GET, all three are required.

  • app_name = The name of your application (eg. My App)
  • app_description = A short, one line description of your application (eg. Simple insights into your Paddle sales and customers.
  • app_icon = An icon for your application, recommended size 150x150. This should be a secure HTTPS URL to an image you host.

Finally, construct your URL, an example of a full URL is below:

https://vendors.paddle.com/vendor/external/integrate?app_name=My%20App&app_description=Simple%20insights%20into%20your%20Paddle%20sales&app_icon=https%3A%2F%2Fwww.paddle.com%2Fassets%2Fpaddle-com%2Fimages%2Flogo.png

Opening the Auth Popup

The second step is actually to show the user the contents of the above URL in a popup. This can be done with Javascript as follows.


var PaddleURL = 'https://vendors.paddle.com/vendor/external/integrate?app_name=My%20App&app_description=Simple%20insights%20into%20your%20Paddle%20sales&app_icon=https%3A%2F%2Fwww.paddle.com%2Fassets%2Fpaddle-com%2Fimages%2Flogo.png';

window.open(PaddleURL, 'paddleAuth', 'location=no,status=0,scrollbars=0,width=800,height=600');

Listening for Token

The final step is to retrieve the token for a successful authentication. Paddle sends this token by sending an event to the window opener called message. This message contains the vendor_id and auth_token. Both of these will be needed if you intend to use the Paddle API.


window.addEventListener('message', function(event) {
    var PaddleData = event.data.split(" ");
    var PaddleVendorID = arrData[0];
    var PaddleAuthToken = arrData[1];
});

Store these values so they can be used to make calls to the Paddle API later.

Was this page helpful?