![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@portkey/did
Advanced tools
Script | Description |
---|---|
clean | Uses rm to remove dist/ |
build | Uses tsc to build package and dependent packages |
lint | Uses eslint to lint package |
lint:fix | Uses eslint to check and fix any warnings |
format | Uses prettier to format the code |
The @portkey/did
library is a collection of modules that contain functionality for the did ecosystem.
@portkey/accounts
is for the portkey account.@portkey/utils
is for the portkey utils.@portkey/contracts
is for the portkey contracts.@portkey/graphql
is for the portkey graphql.@portkey/request
is for the portkey request.@portkey/types
is for the portkey types.@portkey/utils
is for the portkey utils.@portkey/validator
is for the portkey validator.npm install @portkey/did
yarn add @portkey/did
After that you need configure did server node、graphQL node、storage suite.
class Store implements IStorageSuite {
async getItem(key: string) {
return localStorage.getItem(key);
}
async setItem(key: string, value: string) {
return localStorage.setItem(key, value);
}
async removeItem(key: string) {
return localStorage.removeItem(key);
}
}
did.setConfig({
requestDefaults: {
baseURL: 'your did server node',
timeout: 'timeout', // optional default 8000ms
},
graphQLUrl: 'your graphQL node',
storageMethod: new Store(),
});
That’s it! now you can use the did
object.
@portkey/did
API ReferenceWhere you configure did server node, graphQL node, storage suite.
did.setConfig({
requestDefaults: {
baseURL: 'you did server node',
timeout: 'timeout', // optional default 8000ms
},
graphQLUrl: 'your graphQL node',
storageMethod: 'your storage suite',
});
Email or mobile phone number or Google or Apple login.
did.login(type: 'loginAccount', params: AccountLoginParams): Promise<LoginResult>;
Example
did.login('loginAccount', {
chainId: 'chainId',
loginGuardianIdentifier: 'loginGuardianIdentifier',
guardiansApproved: [
{
type: 'Email',
identifier: 'identifier',
verifierId: 'verifierId',
verificationDoc: 'verificationDoc',
signature: 'signature',
},
],
extraData: 'extraData',
context: {
requestId: 'requestId',
clientId: 'clientId',
},
});
Logged in management to add management.
login(type: 'scan', params: ScanLoginParams): Promise<true>;
Example
did.login('scan',{
chainId: 'chainId',
caHash: 'caHash',
managerInfo: {
address: 'address',
extraData: 'extraData'
};
})
getLoginStatus(params: { chainId: ChainId; sessionId: string }): Promise<RecoverStatusResult>;
Example
did.getLoginStatus({
chainId: 'chainId',
sessionId: 'sessionId',
});
logout(params: EditManagerParams): Promise<boolean>;
Example
did.logout({ chainId: 'chainId' });
register(params: Omit<RegisterParams, 'manager'>): Promise<RegisterResult>;
Example
did.register({
type: 'Email',
loginGuardianIdentifier: 'loginGuardianIdentifier',
extraData: 'extraData',
chainId: 'chainId',
verifierId: 'verifierId',
verificationDoc: 'verificationDoc',
signature: 'signature',
context: {
requestId: 'requestId',
clientId: 'clientId',
},
});
getRegisterStatus(params: { chainId: ChainId; sessionId: string }): Promise<RegisterStatusResult>;
Example
did.getRegisterStatus({
chainId: 'chainId',
sessionId: 'sessionId',
});
getHolderInfo by graphQL.
getHolderInfo(params: Pick<GetHolderInfoParams, 'manager' | 'chainId'>): Promise<GetCAHolderByManagerResult>;
Example
did.getHolderInfo({
manager: 'manager', // optional
chainId: 'chainId',
});
getHolderInfo by server.
getHolderInfo(params: Omit<GetHolderInfoParams, 'manager'>): Promise<IHolderInfo>;
Example
did.getHolderInfo({
caHash: 'caHash', // loginGuardianIdentifier and caHash choose one
loginGuardianIdentifier: 'loginGuardianIdentifier', // loginGuardianIdentifier and caHash choose one
chainId: 'chainId',
});
Get the VerifierServer information of the corresponding chain.
getVerifierServers(chainId: ChainId): Promise<VerifierItem[]>;
Example
did.getVerifierServers({
chainId: 'chainId',
});
Check whether the manager has management permissions for the account.
checkManagerIsExist(params:{chainId: ChainId, caHash:string, manager:string}): Promise<boolean>;
Example
did.checkManagerIsExist({
chainId: 'chainId',
caHash: 'caHash',
manager: 'manager'
});
send verification code.
getVerificationCode(params: SendVerificationCodeRequestParams): Promise<SendVerificationCodeResult>;
Example
did.services.getVerificationCode({
params: {
chainId: 'chainId',
guardianIdentifier: 'guardianIdentifier',
type: 'Email',
verifierId: 'verifierId',
operationType: 'operationType',
},
headers: {
reCaptchaToken: 'reCaptchaToken',
},
});
verify verification code.
verifyVerificationCode(params: VerifyVerificationCodeParams): Promise<VerifyVerificationCodeResult>;
Example
did.services.verifyVerificationCode({
verifierSessionId: 'verifierSessionId',
chainId: 'chainId',
guardianIdentifier: 'guardianIdentifier',
verifierId: 'verifierId',
verificationCode: 'verificationCode',
operationType: 'operationType',
});
verify Google token.
verifyGoogleToken(params: VerifierSocialTokenParams): Promise<VerifyVerificationCodeResult>;
Example
did.services.verifyGoogleToken({
chainId: 'chainId',
accessToken: 'accessToken',
verifierId: 'verifierId',
operationType: 'operationType',
});
verify Apple token.
verifyAppleToken(params: VerifyAppleTokenParams): Promise<VerifyVerificationCodeResult>;
Example
did.services.verifyAppleToken({
chainId: 'chainId',
verifierId: 'verifierId',
identityToken: 'identityToken',
operationType: 'operationType',
});
send Apple user extra info.
sendAppleUserExtraInfo(params: SendAppleUserExtraInfoParams): Promise<SendAppleUserExtraInfoResult>;
Example
did.services.sendAppleUserExtraInfo({
identityToken: 'identityToken',
userInfo: {
name: {
firstName: 'firstName',
lastName: 'lastName',
},
email: 'email',
},
});
FAQs
Unknown package
We found that @portkey/did demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.