Initialize
Configure Client ID on the SDK
To authorise and set up the SDK, the method "fize.configure()" is used to initially set up the client ID and additionally customise any parameters and register callback functions. This method is invoked as the first step to set up the SDK.
The method "fize.configure()" is only invoked once for the setup and contains the client ID, configuration parameters, and callback functions.
The client ID is used to identify the party utilising the SDK, and it is used along with secret key that's provided during onboarding to retrieve data from the Fize API's.
The SDK is authorised by the following steps:
- Inside a script tag, create a handler for the method fize.configure({..}).
- Inside the method, add the key "client_id" with the value being the Client ID provided during onboarding.
An example of the implementation in JavaScript below.
<html lang="en">
<head>
<script src="https://cdn.getfize.com/sdk/v1.0/getfize.js"></script>
</head>
<body>
<script>
(function () {
var handler = FIZE.configure({
client_id: "FIZE_PROVIDED_CLIENT_ID"
});
})();
</script>
</body>
</html>
On successful authentication, the callback "onClientAuthenticated()" will be triggered and on unsuccessful authentication, the callback "onClientAuthenticatedError()" will be triggered.
The SDK will not be authorised till the client_id is provided.
Updated 7 months ago