मजकुराकडे जा
Yuva subscribe hookमेनू

Yuva subscribe hook

A React hook over the useyuva headless client: the channel's public mailing lists, subscribing from a form with its form token, and the signed-in user's subscriptions with an identity token.

Loading

    पूर्वावलोकन नमुना डेटावर चालते. त्याला नेटवर्क किंवा चॅनेल लागत नाही.

    इन्स्टॉलेशन

    हे shadcn प्रकल्पात चालवा. फाइल्स तुमच्या स्वतःच्या कोडमध्ये कॉपी होतात.

    Shell
    npx shadcn@latest add https://useyuva.com/r/use-yuva-subscribe.json

    वापर

    tsx
    import { useYuvaSubscribe } from "@/hooks/use-yuva-subscribe"
    
    const { lists, states, subscribe, setSubscribed } = useYuvaSubscribe({ server, channel })

    Props

    UseYuvaSubscribeOptions

    Propप्रकार
    server?string
    channel?string
    client?YuvaClient
    identityToken?IdentityTokenSource | null
    lists?string[]

    YuvaSubscribeState

    Propप्रकार
    inboxNamestring
    listsClientMailingList[]
    statesRecord<string, SubscriptionState | undefined>
    identifiedboolean
    loadingboolean
    errorunknown
    subscribe(input: YuvaSubscribeInput) => Promise<{ confirmation: boolean }>
    setSubscribed(listId: string, on: boolean, consentText: string) => Promise<SubscriptionState>

    अवलंबित्वे

    हा आयटम इन्स्टॉल केल्याने खालील गोष्टीही जोडल्या जातात.

    npm पॅकेजेस