This is the standard way to onboard customers. Your users connect their own
social accounts through the white-labeled JWT URL connect page described below —
they never log in to Ayrshare and never touch your dashboard. The
dashboard is reserved for your
internal team (creating and managing profiles, testing, and posting on a
client’s behalf).
Integration Workflow
To integrate Ayrshare into your application, you’ll need to make two API calls:- Call the Create Profiles endpoint to create a new Ayrshare profile for your user.
- Call the Generate JWT endpoint to get a JWT URL.

For security reasons, social media platforms require users to authenticate through their browser,
which cannot be done through backend server calls. This ensures your users can safely connect
their social media accounts by logging in directly with each platform’s official login page.
Social networks restrict authentication to happen only through their authorized partner domains,
such as Ayrshare. They also block iFrames, which means you cannot embed or display the Ayrshare
linking page within an iFrame on your site.
Create an Ayrshare User Profile
Create a Profile with the API
When a new user registers with your system or when your client clicks the social network link in your app, create a new Ayrshare profile account by calling the /profiles/create-profile RESTful endpoint, or using the NPM or PyPi packages.Profiles
Create a Profile with the Dashboard (Internal Team)
Your internal team can also create User Profiles directly from the Developer Dashboard — useful for testing, onboarding a profile manually, or one-off administration. This is a team tool, not a customer-facing flow: your customers are never given dashboard access and are always onboarded through the JWT URL connect page. For production onboarding, create profiles programmatically with the API so each new user is provisioned automatically.Manage User Profiles in Dashboard
Integration Package
During your onboarding as a Business Plan or Launch Plan client, you received a personalized integration package with important set up and domain information, example endpoint calls, and more. Please check with your primary account holder for this information. You may also retrieve or reset the integration package in the dashboard in the API page. Be sure to first switch to your Primary Profile.
Single Sign-On with JWT Authentication
Ayrshare uses a JWT (JSON Web Token) to authenticate your user and perform Single Sign-On to the social linking page. A JWT is a secure mechanism for passing digitally signed information and allows Ayrshare to authenticate you and your user.Generate a JWT
Your app will construct a JWT comprised of your API Key, user Profile Key, and a few other parameters. This will be signed with your 1024-bit private key.The JWT token is valid for 5 minutes. Please see the Max Pack for longer
expire time.
The JWT URL is the recommended onboarding path for every customer. Your users authenticate
directly with each social network on their own — you never collect or store their social
credentials. If your team needs to link an account manually during testing, you can do so from
the dashboard, but this is an internal convenience and not how customers should be onboarded.
White-Label the Connect Accounts Page
Because the connect page opened by the JWT URL is the only Ayrshare interface your users ever see, you should brand it as your own. Add your logo and custom headers, choose which social networks appear, set the page language, and use your own help links — and with the Max Pack, apply a full custom CSS file, favicon, page title, and footer. These options are configured once by your team from the Primary Profile and apply to every JWT URL you generate.White-Label the Connect Accounts Page
See every branding and customization option for the connect page.
Automatic Logout of a Profile Session
Opening & Closing the Social Linking URL
The Social Accounts page has a “Close” button that closes the window and returns your user to your site.Opening the Social Linking URL
When you open the social linking URL, we recommend using JavaScript’swindow.open() function instead of an anchor href.
The “Close” button uses JavaScript to close the window, and most browsers only allow windows opened via a script to be closed.
You can use the following sample code on your website to launch the social linkage window.
Window Open
Window Open Function
origin=true to the query parameters of the redirect URL.
Please see Generate JWT endpoint for more details.
Redirecting When Closing
Additionally, if you want to have theClose button redirect back to your page (often useful on mobile), pass in the redirect GET parameter as a URL encoded string starting with https.
Please see the Generate JWT endpoint parameters for more details.
JWT URL
redirect parameter is not passed.
To reset the Close button back to close, pass the parameter redirect=null.
More Information
User Linking or Unlinking Notifications
When a user links or unlinks a social network, you can receive a notification via webhook. Please see the Social Action Webhooks page for more information. You may also use the user endpoint to get the connected social networks for a user profile.Multiple Sets of Social Accounts
Overview
Each User Profile has a set of social media accounts and can make one connection to each social network. If your users or clients have multiple sets of social media accounts, such as two Facebook Pages, two Instagram accounts, and two YouTube channels, you can manage these multiple sets of social media accounts by following these steps:- Create multiple User Profiles - Create separate User Profiles within the Ayrshare system for each set of social accounts your user or client needs to manage.
- Store unique Profile Keys - Each User Profile will have its own unique Profile Key, returned from the create User Profile endpoint.
- Label your profiles - Title or tag each User Profile to clearly identify which social media accounts they’re associated with (e.g., “Facebook Page A” and “Facebook Page B”).
- Map in your database - In your own system, associate all relevant Profile Keys with the respective user or client.
- Use appropriate Profile Key - When posting content or retrieving analytics for a specific social account, use the Profile Key associated with that account. For example, to post to Facebook Page A, use the Profile Key of the User Profile connected to Facebook Page A.
Example
Let’s consider a practical scenario for multiple client accounts:- Client: Joe’s Restaurant Chain with two locations
- Facebook Page: “Joe’s Downtown Bistro”
- Instagram: @joesdowntownbistro
- LinkedIn: Joe’s Downtown Bistro business page
- Facebook Page: “Joe’s Seaside Grill”
- Instagram: @joesseasidegrill
- LinkedIn: Joe’s Seaside Grill business page
- Create two separate User Profiles in Ayrshare:
- User Profile 1: Titled “Joe’s Downtown Bistro Accounts”
- User Profile 2: Titled “Joe’s Seaside Grill Accounts”
- Connect the appropriate social accounts to each profile:
- Profile 1: Links the Downtown Bistro Facebook, Instagram, and LinkedIn
- Profile 2: Links the Seaside Grill Facebook, Instagram, and LinkedIn
-
Store both Profile Keys in your database, associating them with Joe’s account:
- When posting a special menu update for the Downtown location, use Profile Key 1 in the API calls. When posting about a seafood promotion at the Seaside location, use Profile Key 2.
