Merge Link


Merge Link is the authentication flow that allows your end-users to connect their third-party accounts to your application. It provides a secure, user-friendly interface for establishing connections.

  1. Generate Link Token: Create a temporary token for the authentication session
  2. Initialize Link Flow: Direct your user to the Merge Link interface
  3. User Authentication: User logs into their third-party account
  4. Account Connection: Merge establishes the connection and creates a Linked Account
  5. Callback: Your application receives the Account Token

Implementation Options

Redirect users to a Merge-hosted page:

1// Generate a Link Token
2const linkToken = await generateLinkToken({
3 end_user_email: "user@example.com",
4 end_user_organization: "Acme Corp",
5 categories: ["hris", "ats"]
6});
7
8// Redirect to Merge Link
9window.location.href = `https://app.merge.dev/link/${linkToken}`;

Embed the Link flow directly in your application:

1<!-- Include Merge Link SDK -->
2<script src="https://cdn.merge.dev/link.js"></script>
3
4<script>
5 MergeLink.create({
6 linkToken: "your_link_token",
7 onSuccess: (accountToken) => {
8 // Handle successful connection
9 console.log("Connected:", accountToken);
10 },
11 onError: (error) => {
12 // Handle errors
13 console.error("Connection failed:", error);
14 }
15 });
16</script>

When generating a Link Token, you can specify:

1{
2 end_user_email: "user@example.com", // Required
3 end_user_organization: "Acme Corp", // Required
4 categories: ["hris"], // API categories to enable
5 integration_specific_config: { // Optional integration settings
6 "bamboohr": {
7 "subdomain": "mycompany"
8 }
9 },
10 webhook_url: "https://yourapp.com/webhooks" // Optional webhook endpoint
11}

Customization

Merge Link can be customized to match your brand:

  • Custom colors and styling
  • Your company logo
  • Custom success/error messages
  • Specific integration selection

Contact your Merge representative for customization options.