Embeds put Lucra's screens inside your app: onboarding, programs, payments, ads, messages. They run in an iframe, so card, bank, and sign-in details never touch your page.
How it works
- Allow your site's origin in Settings → API and MCP.
- Open an embed on your server with
POST /v1/embeds. - Mount it in the browser with
@lucra/sdk/embed, or send the person to its hostedurl.
Server
const { data: embed } = await lucra.as(account).embeds.create({
body: { components: ["onboarding", "creator_programs", "wallet"] },
})
res.json({ clientSecret: embed.clientSecret })
account is a brand (acct_…) or a roster creator (crtr_…). The url lasts 24 hours; the clientSecret works once, for about 10 minutes.
Browser
import { loadLucra, LucraProvider, LucraOnboarding } from "@lucra/sdk/react"
const lucra = loadLucra({ fetchClientSecret })
export function Setup() {
return (
<LucraProvider lucra={lucra}>
<LucraOnboarding onComplete={() => router.push("/dashboard")} />
</LucraProvider>
)
}
Without React, use loadLucra(...).mount("wallet", element).
Components
| Component | For | Does |
|---|---|---|
onboarding | Both | Profile, payments, and connected accounts |
creator_programs | Creators | Find programs, apply, and submit work |
wallet | Creators | Balance and withdrawals |
programs | Brands | Create programs and review work |
payments | Brands | Pay creators and offer retainers |
ads | Brands | Create and manage campaigns |
messages | Both | Conversations |
Open onboarding when an account still has a setup step, like a brand with no payment method.
Appearance
Pass appearance with theme (light, dark, auto), colors.primary, and radius.
Events
Components emit ready, change, complete, error, and close. Your Content Security Policy needs frame-src https://api.onlucra.com.
Endpoints
/v1/embedsOpen Lucra UI for a brand or creator, hosted or embedded
lucra.embeds.create({ body })Body
componentsenum[]requiredWhat the embed can show. programs, payments and ads are for brands; creator_programs and wallet are for creators; onboarding and messages are for either.
onboardingcreator_programswalletprogramspaymentsadsmessagesopenenumThe component the hosted url opens; defaults to the first in components.
onboardingcreator_programswalletprogramspaymentsadsmessagesproviderenumWith onboarding: the platform its connections step lists first.
metatiktokgooglesnapchatshopifyinstagramemailstringPrefill; defaults to the account's contact details.
phonestringreturnUrlstringWhere the hosted page sends the person when they finish.
appearanceobjectShow 3 child fieldsHide child fields
themeenumlightdarkautocolorsobjectShow 1 child fieldHide child fields
primarystringrequired
radiusintegerCorner radius in px.
Response2019 fieldsShow
idemb_…accountstringThe brand (acct_…) or creator (crtr_…) it shows.
componentsenum[]onboardingcreator_programswalletprogramspaymentsadsmessagesstatusenumexpired once expiresAt passes, or when you end it with PATCH.
activeexpiredexpiresAtstringWhen url and any mounted components stop working.
createdAtstringurlstringThe hosted page; send the person here. Lasts 24 hours.
clientSecretstringPass to @lucra/sdk/embed in your frontend. Single use, from an allowed origin.
clientSecretExpiresAtstringMount the components before this; about 10 minutes.
/v1/embedsList the embeds you opened for a brand or creator
lucra.embeds.list({ query })Query parameters
limitintegercursorstringcreatedAfterstringOnly items created at or after this time.
createdBeforestringOnly items created before this time.
Response200A page of items, 6 fields each, and nextCursorShow
idemb_…accountstringThe brand (acct_…) or creator (crtr_…) it shows.
componentsenum[]onboardingcreator_programswalletprogramspaymentsadsmessagesstatusenumexpired once expiresAt passes, or when you end it with PATCH.
activeexpiredexpiresAtstringWhen url and any mounted components stop working.
createdAtstring
/v1/embeds/:idGet an embed
lucra.embeds.retrieve({ path: { id } })Path parameters
idstringrequired
Response2006 fieldsShow
idemb_…accountstringThe brand (acct_…) or creator (crtr_…) it shows.
componentsenum[]onboardingcreator_programswalletprogramspaymentsadsmessagesstatusenumexpired once expiresAt passes, or when you end it with PATCH.
activeexpiredexpiresAtstringWhen url and any mounted components stop working.
createdAtstring
/v1/embeds/:idEnd an embed early
lucra.embeds.update({ path: { id }, body })Path parameters
idstringrequired
Body
statusstringrequiredEnds it now: the hosted url and mounted components stop working.
expired
Response2006 fieldsShow
idemb_…accountstringThe brand (acct_…) or creator (crtr_…) it shows.
componentsenum[]onboardingcreator_programswalletprogramspaymentsadsmessagesstatusenumexpired once expiresAt passes, or when you end it with PATCH.
activeexpiredexpiresAtstringWhen url and any mounted components stop working.
createdAtstring