Skip to main content
Use a connect link when you want to trigger authorization without opening Connect UI immediately in your app (for example: email-based onboarding, support-assisted setup, or cross-device flows). Create a connect session and return the connect_link to your frontend or internal tools:
import { Nango } from '@nangohq/node';

const nango = new Nango({ secretKey: process.env['<NANGO-SECRET-KEY>'] });

api.post('/connectLink', async (req, res) => {
  const { data } = await nango.createConnectSession({
    tags: {
      end_user_id: '<END-USER-ID>',
      end_user_email: '<END-USER-EMAIL>',
      organization_id: '<ORGANIZATION-ID>'
    },
    allowed_integrations: ['<INTEGRATION-ID>']
  });

  res.status(200).send({
    connectLink: data.connect_link,
    expiresAt: data.expires_at
  });
});
The returned connect_link expires after 30 minutes. In the Nango dashboard, open the Connections page and use the Share connect link button. This generates a link that you can share directly with the end user.

Notes