Authentication

Button uses your API key for API endpoint access. Additionally, certain endpoints are available through the SDK with a user session.

API keys are issued through the Button Dashboard. To locate your API key(s):

For requests that require an API key, Button expects the API key via Basic Auth.

The Authorization header field is constructed as follows:

  1. Add a colon to the end of the api key (e.g. apiKey + ":")
  2. Base64 encode the resulting string
  3. The authorization method and a space i.e. "Basic " is then put before the encoded string. (e.g. "Basic " + base64Encode(apiKey + ":")

Warning: Keep your API Key Private

Only use your API Key from a server that you control. Do not embed your API Key in a mobile app or public webpage.