It enables you to connect social accounts directly through your app, but required more work to set up.
Copy
const response = await bundlesocial.socialAccount.socialAccountConnect({ requestBody: { type: 'TIKTOK', teamId: team.id, redirectUrl: 'https://your-redirect-url.com', }});// Redirect the user to the response.url// After the user has connected the account, the user will be redirected to the redirectUrl
Select page, account or channel (required for FACEBOOK, INSTAGRAM, YOUTUBE and LINKEDIN)
After the user has connected the account and was redirected to your page, you can let the user select the page, account or channel. We unified the data for all platforms. Each social account has a channels field, that is an array of their channels (pages, accounts, channels depending on the platform).
// this is a simple example using expressapp.post('/webhook', express.json({ type: 'application/json' }), (req, res) => { const bundlesocial = new Bundlesocial(apiKey); const signature = req.headers['x-signature']; let event: WebhookEvent; try { // Verify the webhook signature and return a typed event event = bundlesocial.webhooks.constructEvent( req.body, signature as string, secret, ); // Do something with the event } catch (err) { console.log(`Webhook signature verification failed.`, err); return res.sendStatus(400); } return res.send();});