Client SDK to make authorized API calls to backend
How to make authorized request to your application server after login with Authgear
Using Authgear SDK to call your application server
Overview
SDK Setup
authgear
.configure({
clientID: "<YOUR_APPLICATION_CLIENT_ID>",
endpoint: "<YOUR_AUTHGEAR_ENDPOINT>",
})
.then(() => {
// configured successfully
})
.catch((e) => {
// failed to configured
});let authgear = Authgear(clientId: clientId, endpoint: endpoint)
authgear.configure() { result in
switch result {
case .success():
// configured successfully
case let .failure(error):
// failed to configured
}
}ConfigureOptions configureOptions = new ConfigureOptions();
Authgear authgear = new Authgear(getApplication(), clientID, endpoint);
authgear.configure(configureOptions, new OnConfigureListener() {
@Override
public void onConfigured() {
// configured successfully
}
@Override
public void onConfigurationFailed(@NonNull Throwable throwable) {
// failed to configured
}
});UserInfo and Session State
Makeing an API call
The fetch function (JavaScript Only)
fetch function (JavaScript Only)The refreshAccessTokenIfNeeded function
Handle revoked sessions
Last updated
Was this helpful?