सामग्री पर जाएँ
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 पैकेज