Forkast Developer Docs
...
Account
Authenticate with Key
2 min
authenticates a user by signing a predefined message with their wallet private key the sdk sends the wallet address, signature, and message to forkast and returns an access token used for authenticated api calls import { forkastsdk, network, loginresponse } from "@forkastgg/client"; const sdk = new forkastsdk(network mainnet, "your api key"); const accountservice = sdk getaccountservice(); // step 1 load existing forkast wallet key const privatekey = getstoredprivatekey(); // must have been created manually if (!privatekey) { throw new error( "forkast wallet not found complete sign up manually on the platform first " ); } // step 2 login using forkast wallet private key const loginresponse = await accountservice loginwithprivatekey(privatekey); const accesstoken = loginresponse accesstoken; console log("access token ", accesstoken); parameters field type required description key string yes private key of your wallet note the user must complete the forkast wallet sign up on the forkast platform bots cannot create wallets automatically the private key must be securely stored and accessible for login keyless wallets are not supported at this time social and email login methods are not allowed for automation a valid forkast api key must be set in the environment variables the accesstoken returned in loginresponse is required for all authenticated api calls store it securely and pass it as the accesstoken argument when calling protected service methods