इंस्टॉलेशन और Deep Links
इंस्टॉलेशन और Deep Links
Installation links Stripe App को marketplace के बाहर distribute करने की सुविधा देते हैं, जबकि deep links users को installed app के specific views तक directly navigate करते हैं।
Installation Links
Installation Link Format
https://marketplace.stripe.com/oauth/v2/authorize?client_id=APP_ID&redirect_uri=REDIRECT_URI&state=STATE_VALUECSRF Protection
Cross-site request forgery attacks रोकने के लिए state parameter हमेशा use करें:
import crypto from 'crypto';
const generateInstallLink = (req, res) => { const state = crypto.randomBytes(32).toString('hex');
req.session.stripeInstallState = state;
const installUrl = new URL('https://marketplace.stripe.com/oauth/v2/authorize'); installUrl.searchParams.set('client_id', 'com.tajo.brevo-integration'); installUrl.searchParams.set('redirect_uri', 'https://tajo.io/stripe/callback'); installUrl.searchParams.set('state', state);
res.redirect(installUrl.toString());};Deep Links
Deep links users को directly installed Stripe App के specific view तक navigate करते हैं।
Deep Link URL Format
https://dashboard.stripe.com/MODE/acct_ID/PAGE?apps[APP_ID][TARGET]=VIEWPORT_IDDeep Link Examples
Customer Detail View Open करें
https://dashboard.stripe.com/live/acct_xxxxx/customers/cus_xxxxx ?apps[com.tajo.brevo-integration][drawer]=stripe.dashboard.customer.detailSettings Modal Open करें
https://dashboard.stripe.com/live/acct_xxxxx/settings ?apps[com.tajo.brevo-integration][modal]=stripe.dashboard.settingsProgrammatic Deep Link Generation
const generateDeepLink = ({ accountId, mode = 'live', page, appId = 'com.tajo.brevo-integration', target = 'drawer', viewport,}) => { const baseUrl = `https://dashboard.stripe.com/${mode}/${accountId}/${page}`; const params = new URLSearchParams(); params.set(`apps[${appId}][${target}]`, viewport);
return `${baseUrl}?${params.toString()}`;};Tip
Installation links और deep links को live और test mode दोनों में test करें यह verify करने के लिए कि वे हर environment में properly काम करते हैं।
अगले कदम
- Post-Install Actions, Installation के बाद onboarding
- Analytics, Installation metrics track करें