Autenticação
authnamespaceLogin, sessão, cadastro e recuperação de senha.
authnamespaceEsta página é gerada automaticamente pelo
@luckymaker/sdk-generator. Não edite manualmente.
changePassword
Seção intitulada “changePassword”/user/passwordAssinatura:
changePassword(body?: ChangePasswordBody, settings?: SdkSettings): Promise<ChangePasswordResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
currentPassword |
string |
não |
newPassword |
string |
sim |
newPasswordConfirmation |
string |
sim |
type ChangePasswordBody = { "currentPassword"?: string; "newPassword": string; "newPasswordConfirmation": string; };type ChangePasswordResponse = unknown;Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.changePassword({ "newPassword": "string", "newPasswordConfirmation": "string" });Testar esta função no playground
exchangeImpersonation
Seção intitulada “exchangeImpersonation”/user/impersonation/exchangeAssinatura:
exchangeImpersonation(body?: ExchangeImpersonationBody, settings?: SdkSettings): Promise<ExchangeImpersonationResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
code |
string |
sim |
type ExchangeImpersonationBody = { "code": string; };type ExchangeImpersonationResponse = { "token": string; "expiresIn": number; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.exchangeImpersonation({ "code": "string" });Testar esta função no playground
Esta chamada salva automaticamente o token retornado para as próximas requisições.
getIdentification
Seção intitulada “getIdentification”/user/identificationAssinatura:
getIdentification(settings?: SdkSettings): Promise<GetIdentificationResponse>type GetIdentificationResponse = { "isRegistered"?: boolean; "signUpForm"?: unknown; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.getIdentification();Testar esta função no playground
getRecoveryMethods
Seção intitulada “getRecoveryMethods”/user/password/recovery-methodsAssinatura:
getRecoveryMethods(query?: GetRecoveryMethodsQuery, settings?: SdkSettings): Promise<GetRecoveryMethodsResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
cpf |
string |
não |
type GetRecoveryMethodsQuery = { "cpf"?: string; };type GetRecoveryMethodsResponse = Array<{ "id": string; "label": string; }>;Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.getRecoveryMethods();Testar esta função no playground
getSession
Seção intitulada “getSession”/user/sessionAssinatura:
getSession(settings?: SdkSettings): Promise<GetSessionResponse>type GetSessionResponse = { "user": { "id": number; "name": string; "email": string; "state"?: string; "city"?: string; "isProfileComplete"?: boolean; "isBetaTester"?: boolean; "enabledTests"?: Array<"CREDITS_WITHDRAWAL">; "functions"?: Array<"TEST_ACCOUNT" | "SYSDEV">; }; "session": { "expiresIn": number; }; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.getSession();Testar esta função no playground
getSignUp
Seção intitulada “getSignUp”/user/sign-upAssinatura:
getSignUp(settings?: SdkSettings): Promise<GetSignUpResponse>type GetSignUpResponse = { "form": unknown; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.getSignUp();Testar esta função no playground
identify
Seção intitulada “identify”/user/identificationAssinatura:
identify(body?: IdentifyBody, settings?: SdkSettings<IdentifyQuery>): Promise<IdentifyResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
intent |
"DOCUMENT_ACCESS" |
não |
scope |
"PURCHASED_TITLES" |
não |
| Nome | Tipo | Obrigatório |
|---|---|---|
captcha |
string |
não |
cpf |
string |
sim |
birthdate |
string |
não |
quick |
boolean |
não |
type IdentifyQuery = { "intent"?: "DOCUMENT_ACCESS"; "scope"?: "PURCHASED_TITLES"; };type IdentifyBody = { "captcha"?: string; "cpf": string; "birthdate"?: string; "quick"?: boolean; };type IdentifyResponse = { "isRegistered"?: boolean; "signUpForm"?: unknown; "documentAccessToken"?: string; "expiresAt"?: string; "identificationProof"?: string; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.identify({ "cpf": "string" });Testar esta função no playground
recoverAffiliatePassword
Seção intitulada “recoverAffiliatePassword”/affiliate/recover-passwordAssinatura:
recoverAffiliatePassword(body?: RecoverAffiliatePasswordBody, settings?: SdkSettings): Promise<RecoverAffiliatePasswordResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
| - | { "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "WHATSAPP" | "EMAIL" | "SMS"; "document": string; } | { "captcha": string; "stage": "CONFIRM_CODE"; "recoveryMethod"?: "WHATSAPP" | "EMAIL" | "SMS"; "document": string; "code": string; } | { "captcha": string; "stage": "CHANGE_PASSWORD"; "document": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; } |
- |
type RecoverAffiliatePasswordBody = { "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "WHATSAPP" | "EMAIL" | "SMS"; "document": string; } | { "captcha": string; "stage": "CONFIRM_CODE"; "recoveryMethod"?: "WHATSAPP" | "EMAIL" | "SMS"; "document": string; "code": string; } | { "captcha": string; "stage": "CHANGE_PASSWORD"; "document": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; };type RecoverAffiliatePasswordResponse = { "lastDigits": string; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.recoverAffiliatePassword({ "captcha": "string", "stage": "REQUEST_CODE", "recoveryMethod": "WHATSAPP", "document": "string" });Testar esta função no playground
recoverPassword
Seção intitulada “recoverPassword”/user/password/recoverAssinatura:
recoverPassword(body?: RecoverPasswordBody, settings?: SdkSettings): Promise<RecoverPasswordResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
| - | { "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "EMAIL" | "SMS" | "WHATSAPP"; "cpf": string; "inbox"?: string; } | { "stage": "CONFIRM_CODE"; "recoveryMethod": "EMAIL" | "SMS" | "WHATSAPP"; "cpf": string; "code": string; } | { "stage": "CHANGE_PASSWORD"; "cpf": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; } |
- |
type RecoverPasswordBody = { "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "EMAIL" | "SMS" | "WHATSAPP"; "cpf": string; "inbox"?: string; } | { "stage": "CONFIRM_CODE"; "recoveryMethod": "EMAIL" | "SMS" | "WHATSAPP"; "cpf": string; "code": string; } | { "stage": "CHANGE_PASSWORD"; "cpf": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; };type RecoverPasswordResponse = { "redactedInbox": string; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.recoverPassword({ "captcha": "string", "stage": "REQUEST_CODE", "recoveryMethod": "EMAIL", "cpf": "string" });Testar esta função no playground
renewSession
Seção intitulada “renewSession”/user/session/renewAssinatura:
renewSession(settings?: SdkSettings): Promise<RenewSessionResponse>type RenewSessionResponse = { "token": string; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.renewSession();Testar esta função no playground
Esta chamada salva automaticamente o token retornado para as próximas requisições.
/user/sign-inAssinatura:
signIn(body?: SignInBody, settings?: SdkSettings): Promise<SignInResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
captcha |
string |
sim |
cpf |
string |
sim |
password |
string |
sim |
type SignInBody = { "captcha": string; "cpf": string; "password": string; };type SignInResponse = { "token": string; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.signIn({ "captcha": "string", "cpf": "string", "password": "string" });Testar esta função no playground
Esta chamada salva automaticamente o token retornado para as próximas requisições.
signInWithFacebook
Seção intitulada “signInWithFacebook”/user/sign-in/oauth/facebookAssinatura:
signInWithFacebook(body?: SignInWithFacebookBody, settings?: SdkSettings): Promise<SignInWithFacebookResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
accessToken |
string |
sim |
cpf |
string |
não |
type SignInWithFacebookBody = { "accessToken": string; "cpf"?: string; };type SignInWithFacebookResponse = unknown;Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.signInWithFacebook({ "accessToken": "string" });Testar esta função no playground
signOut
Seção intitulada “signOut”/user/sign-outAssinatura:
signOut(settings?: SdkSettings): Promise<SignOutResponse>type SignOutResponse = unknown;Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.signOut();Testar esta função no playground
Esta chamada remove o token salvo pela SDK.
/user/sign-upAssinatura:
signUp(body?: SignUpBody, settings?: SdkSettings<SignUpQuery>): Promise<SignUpResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
utm_source |
string |
não |
utm_medium |
string |
não |
utm_campaign |
string |
não |
utm_term |
string |
não |
utm_content |
string |
não |
utm_id |
string |
não |
affiliate_id |
string | number |
não |
reseller_id |
string | number |
não |
reseller_slug |
string | number |
não |
reseller_uuid |
string |
não |
referrer_domain |
string |
não |
lm_medium |
string |
não |
lm_source |
string |
não |
lm_purchase_source |
"APP" | "API" | "PHYSICAL" | "DESKTOP_WEB" | "MOBILE_WEB" | "TABLET_WEB" | "EMBED" | "LANDING_PAGE" | "WEBSITE" | "UNKNOWN" | "STUB" | "SUBSCRIPTION" |
não |
lm_cohort |
string |
não |
device_id |
string |
não |
onesignal_player_id |
string |
não |
fbclid |
string |
não |
click_id |
string |
não |
gclid |
string |
não |
ttclid |
string |
não |
lm_partner_id |
string |
não |
lm_webhook_url |
string |
não |
lm_fast_sell_identifier |
string |
não |
lm_offer_id |
string |
não |
lm_offer_coupon |
string |
não |
lm_plan_id |
string |
não |
| Nome | Tipo | Obrigatório |
|---|---|---|
captcha |
string |
sim |
cpf |
string |
sim |
tel |
string |
sim |
email |
string |
não |
password |
string |
não |
name |
string |
não |
originalName |
string |
não |
socialName |
string | null |
não |
birthdate |
string |
não |
gender |
"M" | "F" | "O" | "N" | null |
não |
idd |
string |
não |
address |
{ "cep"?: string; "streetName"?: string | null; "number"?: string; "neighborhood"?: string | null; "complement"?: string; } |
não |
formId |
string |
não |
quickToken |
string |
não |
referralUuid |
string |
não |
affiliate_id |
string | number |
não |
reseller_id |
string | number |
não |
reseller_slug |
string | number |
não |
reseller_uuid |
string |
não |
type SignUpQuery = { "utm_source"?: string; "utm_medium"?: string; "utm_campaign"?: string; "utm_term"?: string; "utm_content"?: string; "utm_id"?: string; "affiliate_id"?: string | number; "reseller_id"?: string | number; "reseller_slug"?: string | number; "reseller_uuid"?: string; "referrer_domain"?: string; "lm_medium"?: string; "lm_source"?: string; "lm_purchase_source"?: "APP" | "API" | "PHYSICAL" | "DESKTOP_WEB" | "MOBILE_WEB" | "TABLET_WEB" | "EMBED" | "LANDING_PAGE" | "WEBSITE" | "UNKNOWN" | "STUB" | "SUBSCRIPTION"; "lm_cohort"?: string; "device_id"?: string; "onesignal_player_id"?: string; "fbclid"?: string; "click_id"?: string; "gclid"?: string; "ttclid"?: string; "lm_partner_id"?: string; "lm_webhook_url"?: string; "lm_fast_sell_identifier"?: string; "lm_offer_id"?: string; "lm_offer_coupon"?: string; "lm_plan_id"?: string; };type SignUpBody = { "captcha": string; "cpf": string; "tel": string; "email"?: string; "password"?: string; "name"?: string; "originalName"?: string; "socialName"?: string | null; "birthdate"?: string; "gender"?: "M" | "F" | "O" | "N" | null; "idd"?: string; "address"?: { "cep"?: string; "streetName"?: string | null; "number"?: string; "neighborhood"?: string | null; "complement"?: string; }; "formId"?: string; "quickToken"?: string; "referralUuid"?: string; "affiliate_id"?: string | number; "reseller_id"?: string | number; "reseller_slug"?: string | number; "reseller_uuid"?: string; };type SignUpResponse = { "pendingRegistration"?: { "formId": string; "form": unknown; }; [key: string]: unknown; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.signUp({ "captcha": "string", "cpf": "string", "tel": "string" });Testar esta função no playground
updateSignUpPending
Seção intitulada “updateSignUpPending”/user/sign-up/pendingAssinatura:
updateSignUpPending(body?: UpdateSignUpPendingBody, settings?: SdkSettings): Promise<UpdateSignUpPendingResponse>| Nome | Tipo | Obrigatório |
|---|---|---|
cpf |
string |
sim |
formId |
string |
sim |
type UpdateSignUpPendingBody = { "cpf": string; "formId": string; [key: string]: unknown; };type UpdateSignUpPendingResponse = null;Exemplo
Seção intitulada “Exemplo”const response = await sdk.auth.updateSignUpPending({ "cpf": "string", "formId": "string" });