OAuth2 Authorization Code Parameter Definitions

These are the parameters required to successfully implement the OAuth2.0 authorization grant flow to access Snap resources.

ParameterDefinition
client_idThe client ID Snap assigned to your application when you signed up for Snap Kit, the value is a 36 character alphanumeric string.
client_secretThe client secret Snap assigned to your application when you signed up for Snap Kit. The value is a BASE64 URL encoded string.
redirect_uriThe redirect URI that you requested for your application.
scopeA URL safe space-delimited string of OAuth2.0 token scopes. These scope(s) were assigned to your application when you sign up for Snap Kit. These scopes handle what content your application can and cannot access.

As an example, if your application is assigned the OAuth2.0 scopes “ https://auth.snapchat.com/oauth2/api/example.abc” and “ https://auth.snapchat.com/oauth2/api/example.xyz” . Then your scope value would be: “https%3A%2F%2Fauth.snapchat.com%2Foauth2%2Fapi%2Fexample.abc%20https%3A%2F%2Fauth.snapchat.com%2Foauth2%2Fapi%2Fexample.xyz”
state"state” is a base64 URL encoded string. This value is used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client. The parameter SHOULD be used for preventing cross-site request forgery.
response_typeValue MUST be set to “code”
grant_typePossible values include “authorization code” or “refresh token”
codeThe authorization code received from the authorization server.
access_tokenThe users access token received from the authorization server. Used to gain access to various user data.
refresh_tokenThe users refresh token received from the authorization server. Will need to be used when refreshing an expiring access_token.
expires_inThe expiry time (in seconds) of the access_token.

Bitmoji Kit Web Sticker Picker Parameter Definitions

These are the parameters required to successfully integrate the Sticker Picker into your web application.

NameTypeDescription
bitmojiWebPickerIconClassstringThe element class name Bitmoji icons will be mounted on. We use a HTML class value so you can mount the UI in multiple places in your web application.
loginParamsObjObjectStores the OAuth2 login parameters required to gain access to Bitmoji content.
loginParamsObj.clientIdstringThe client ID Snap assigned to your application when you signed up for Snap Kit, the value is a 36 character alphanumeric string.

An example client ID would be “1234abcd-blah-7890-foo654321bar”.
loginParamsObj.redirectURIstringThe URL that handles and completes login requests. The value of this URL will be requested by you and most often will route to a part of your web application that has integrated the Bitmoji Sticker Picker UI.

As an example, your test web application (with integrated Sticker Picker UI) is deployed to www.my-test-application.com. An example of a redirectURI value for this case would be “www.my-test-application.com”. You might have also integrated the Sticker Picker UI to your accounts page, which is routed to www.my-test-application.com/accounts. In that scenario, you can specific that your redirectURI is also “www.my-test-application.com/accounts”. Note: RedirectURIs can be any public URL with the HTTPS protocol as long as it is owned by you OR “localhost: ” for development purposes. You may specify up to 10 different redirectURI values for your application.
loginParamsObj.scopeListstringThe scope(s) assigned to your application when you sign up for Snap Kit. These scopes handle what content your application can and cannot access.

An example of a scope value is “ https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar” which gives your application access to the Sticker Picker library.
loginParamsObj.handleAuthGrantFlowCallback (optional)func()The callback you can specific to handle your own OAuth2 flow.
uiOptionsObjectThe customizable options for UI styles and interactions.
uiOptions.onStickerPickCallbackfunc(string)The callback used to handle the response when user clicks on a Bitmoji sticker on the sticker picker UI. When the user clicks on a Bitmoji, the callback will return the URL that can be used to render the image. It is up to you how you want to use this URL.

An example would be to use this URL as the 'SRC' for a HTML tag.
uiOptions.webpickerPositionstringYou can specify this parameter to determine where the sticker picker UI will be positioned relative to the Bitmoji icon.

There are six options: 'topRight' (default), 'topLeft', 'topMiddle', 'bottomRight', 'bottomMiddle', and 'bottomLeft',.
uiOptions.iconOverrideObjectThis object will represent all icon related overrides.

For example:
iconOverride: { size: 60, style: 'Customizable' }
uiOptions.iconOverride.sizenumberThis value represents the size of the icon in pixels. The default value is 48.
uiOptions.iconOverride.stylestringThis value represents the style of the icon.

Currently there are only two possible values:
1) ‘Standard’ (default value) - This will show https://sdk.bitmoji.com/assets/bitmoji-no-avatar-icon.svg
2) ‘Customizable’ - This will show https://sdk.bitmoji.com/assets/bitmoji-no-avatar-icon-blank.svg
uiOptions.iconOverride.fillColorstringThis value represents the fill color of the ‘Customizable’ icon. This value must be a hex color code.

For example: #000000, #FF0000, or #C0C0C0