#steven_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1422313733639770152
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- steven_apps-sandbox, 5 days ago, 14 messages
import { loadConnectAndInitialize } from "@stripe/connect-js";
const fetchClientSecret = async () => {
// Fetch the AccountSession client secret
const response = await fetch('/account_session', { method: "POST" });
if (!response.ok) {
// Handle errors on the client side here
const {error} = await response.json();
console.log('An error occurred: ', error);
document.querySelector('#container').setAttribute('hidden', '');
document.querySelector('#error').removeAttribute('hidden');
return undefined;
} else {
const {client_secret: clientSecret} = await response.json();
document.querySelector('#container').removeAttribute('hidden');
document.querySelector('#error').setAttribute('hidden', '');
return clientSecret;
}
}
const instance = loadConnectAndInitialize({
// This is your test publishable API key.
publishableKey: "pk_test_5xxxxxxxxxHF6VSG6",
fetchClientSecret: fetchClientSecret,
appearance: {
overlays: 'dialog',
variables: {
colorPrimary: '#625afa',
},
},
});
const container = document.getElementById("container");
const paymentsComponent = instance.create("payments");
container.appendChild(paymentsComponent);
const installContainer = document.getElementById('app-install-container');
const appInstall = instance.create('app-install');
appInstall.setApp('com.chargeblast.cbalert'); // works fine up to here
appInstall.setOnAppInstallStateFetched(handleAppInstallFetched);
appInstall.setOnAppInstallStateChanged(handleAppInstallChanged);
installContainer.appendChild(appInstall);
Thanks for the info, looking in to this. Can you link to the doc you are following here?
is it possible the frontend needs a beta feature flag or version set (as the backend does) to use this .setApp function? This seems like the likely issue here.
import { loadConnectAndInitialize } from "@stripe/connect-js";
const instance = loadConnectAndInitialize({
// This is your test publishable API key.
publishableKey: "pk_test_******F6VSG6",
fetchClientSecret: fetchClientSecret,
appearance: {
overlays: 'dialog',
variables: {
colorPrimary: '#625afa',
},
},
});
right now I load it like so
Whereas on the backend, in order to get the app embedded stuff to work I do:
const stripe = require("stripe")(
// This is your test secret API key.
'sk_test_51R******L7FAYbwl',
{apiVersion: '2025-07-30.basil; embedded_connect_beta=v2;'}
);
Hello, apologies for the delay. We have special varients of our clients for preview features. I think you need to use the preview version of connect.js here:
https://docs.stripe.com/connect/supported-embedded-components#preview-components
Nice! Glad we could help
could be useful to add that to the docs ๐
Absolutely, will file that feedback