Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt

Use this file to discover all available pages before exploring further.

Request user authorization and get an authorization code for backend token exchange.

Parameters

PropertyTypeRequiredDescription
scopesArrayNoAuthorization scopes to request. Defaults to ['auth_base']
successFunctionNoCallback with auth code
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Authorization Scopes

ScopeData Accessible
auth_baseUser ID only (default, silent where permitted)
auth_userFull user profile
USER_NICKNAMEDisplay name
USER_NAMEFirst and last name
USER_LOGIN_IDLogin identifier
USER_AVATARAvatar image URL
USER_GENDERGender
USER_BIRTHDAYDate of birth
USER_NATIONALITYNationality
USER_PHONE_NUMBERPhone number
USER_SHIPPING_ADDRESSShipping address
USER_RESIDENT_ADDRESSResident address
NOTIFICATION_INBOXInbox message permission
NOTIFICATION_PUSHPush notification permission
codice_fiscaleItalian tax identification code
Silent authorization (auth_base without a prompt) is only available for first-party Mini Programs. All third-party Mini Programs require explicit user authorization.

Success Callback

PropertyTypeDescription
authCodeStringShort-lived authorization code
authSuccessScopesArraySuccessfully authorized scopes
authErrorScopesObjectScopes that were denied and the reason

Error Codes

CodeDescription
2Invalid parameters
10Network timeout
11User cancelled authorization

Code Example

my.getAuthCode({
  scopes: ['auth_user'],
  success: (res) => {
    console.log('Auth code:', res.authCode);
    // Send to backend for token exchange
    this.sendToBackend(res.authCode);
  },
  fail: (err) => {
    console.error('Authorization failed:', err);
  }
});
The authCode is short-lived and single-use. It must be exchanged server-side via the Rebell OpenAPI for a user context. Never validate the authCode client-side.

my.getOpenUserInfo

Get user information

Backend Authentication

Auth code exchange guide