Reference

Build on the Lucra API.

Drag a sticker to move it, or use the arrow keys while focused.

Embeds

Put Lucra's screens inside your app.

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

  1. Allow your site's origin in Settings → API and MCP.
  2. Open an embed on your server with POST /v1/embeds.
  3. Mount it in the browser with @lucra/sdk/embed, or send the person to its hosted url.

Server

TypeScript
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

tsx
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

ComponentForDoes
onboardingBothProfile, payments, and connected accounts
creator_programsCreatorsFind programs, apply, and submit work
walletCreatorsBalance and withdrawals
programsBrandsCreate programs and review work
paymentsBrandsPay creators and offer retainers
adsBrandsCreate and manage campaigns
messagesBothConversations

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

POST/v1/embeds
As creatorwrite

Open Lucra UI for a brand or creator, hosted or embedded

SDKlucra.embeds.create({ body })

Body

  • componentsenum[]required

    What 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_programswalletprogramspaymentsadsmessages
  • openenum

    The component the hosted url opens; defaults to the first in components.

    onboardingcreator_programswalletprogramspaymentsadsmessages
  • providerenum

    With onboarding: the platform its connections step lists first.

    metatiktokgooglesnapchatshopifyinstagram
  • emailstring

    Prefill; defaults to the account's contact details.

  • phonestring
  • returnUrlstring

    Where the hosted page sends the person when they finish.

  • appearanceobject
    Show 3 child fields
    • themeenum
      lightdarkauto
    • colorsobject
      Show 1 child field
      • primarystringrequired
    • radiusinteger

      Corner radius in px.

Response2019 fieldsShow
  • idemb_…
  • accountstring

    The brand (acct_…) or creator (crtr_…) it shows.

  • componentsenum[]
    onboardingcreator_programswalletprogramspaymentsadsmessages
  • statusenum

    expired once expiresAt passes, or when you end it with PATCH.

    activeexpired
  • expiresAtstring

    When url and any mounted components stop working.

  • createdAtstring
  • urlstring

    The hosted page; send the person here. Lasts 24 hours.

  • clientSecretstring

    Pass to @lucra/sdk/embed in your frontend. Single use, from an allowed origin.

  • clientSecretExpiresAtstring

    Mount the components before this; about 10 minutes.

GET/v1/embeds
As creatorread

List the embeds you opened for a brand or creator

SDKlucra.embeds.list({ query })

Query parameters

  • limitinteger
  • cursorstring
  • createdAfterstring

    Only items created at or after this time.

  • createdBeforestring

    Only items created before this time.

Response200A page of items, 6 fields each, and nextCursorShow
  • idemb_…
  • accountstring

    The brand (acct_…) or creator (crtr_…) it shows.

  • componentsenum[]
    onboardingcreator_programswalletprogramspaymentsadsmessages
  • statusenum

    expired once expiresAt passes, or when you end it with PATCH.

    activeexpired
  • expiresAtstring

    When url and any mounted components stop working.

  • createdAtstring
GET/v1/embeds/:id
As creatorread

Get an embed

SDKlucra.embeds.retrieve({ path: { id } })

Path parameters

  • idstringrequired
Response2006 fieldsShow
  • idemb_…
  • accountstring

    The brand (acct_…) or creator (crtr_…) it shows.

  • componentsenum[]
    onboardingcreator_programswalletprogramspaymentsadsmessages
  • statusenum

    expired once expiresAt passes, or when you end it with PATCH.

    activeexpired
  • expiresAtstring

    When url and any mounted components stop working.

  • createdAtstring
PATCH/v1/embeds/:id
As creatorwrite

End an embed early

SDKlucra.embeds.update({ path: { id }, body })

Path parameters

  • idstringrequired

Body

  • statusstringrequired

    Ends it now: the hosted url and mounted components stop working.

    expired
Response2006 fieldsShow
  • idemb_…
  • accountstring

    The brand (acct_…) or creator (crtr_…) it shows.

  • componentsenum[]
    onboardingcreator_programswalletprogramspaymentsadsmessages
  • statusenum

    expired once expiresAt passes, or when you end it with PATCH.

    activeexpired
  • expiresAtstring

    When url and any mounted components stop working.

  • createdAtstring