@8base/api-token-auth-client 中文文档教程
8base api token auth client
AuthProvider
的 8base api 令牌身份验证客户端。
ApiTokenAuthClient
Table of Contents
ApiTokenAuthClient
创建 api 令牌身份验证客户端的实例
Parameters
apiToken
string Api Token generated in 8base app.apiToken.apiToken
Usage
import { AuthContext, AuthProvider, type AuthContextProps } from '@8base/react-auth';
import { ApiTokenAuthClient } form '@8base/api-token-auth-client';
const authClient = new ApiTokenAuthClient({
apiToken: 'api-token',
});
...
<AuthProvider authClient={ authClient }>
...
<AuthContext.Consumer>
{
(auth: AuthContextProps) => (<div />)
}
</AuthContext.Consumer>
...
</AuthProvider>
8base api token auth client
The 8base api token auth client for the AuthProvider
.
ApiTokenAuthClient
Table of Contents
ApiTokenAuthClient
Create instance of the api token auth client
Parameters
apiToken
string Api Token generated in 8base app.apiToken.apiToken
Usage
import { AuthContext, AuthProvider, type AuthContextProps } from '@8base/react-auth';
import { ApiTokenAuthClient } form '@8base/api-token-auth-client';
const authClient = new ApiTokenAuthClient({
apiToken: 'api-token',
});
...
<AuthProvider authClient={ authClient }>
...
<AuthContext.Consumer>
{
(auth: AuthContextProps) => (<div />)
}
</AuthContext.Consumer>
...
</AuthProvider>