๐ŸงชTesting

Tips & tricks for testing your application integrations with Picket

Frontend

Token Gates

There are two scenarios you'll run into when building token-gated apps.

You either (A) have the required tokens or (B) you don't have the required token.

(A) You have the required tokens

If you hold the token you are using to gate your product, then manual testing is trivial. You can login with your wallet that holds the necessary tokens to pass the token gate and verify everything works as expected. Similarly, you can login with a different wallet that doesn't hold the required tokens and verify you are blocked from accessing the token gated content.

(B) You don't have the required tokens

NFTs are typically limited in supply, so it's common to not own the required tokens for every token gated part of your application. This is especially pertinent for application that has separate communities for token holders, like BEB.

The simplest way to test token gated apps, which you don't have the required tokens for, is to use the allowedWallets parameter for every login request in your app. Login requirements are always treated as a logical OR, meaning users are allowed if they meet any of the requirements.

With allowedWallets you can allow your teammates or service accounts to access content that they do not hold the necessary tokens for. You can read more about how to use allowedWallets in the quick start guide.

Backend

APIs

You can use the Picket API or Node SDK to generate access tokens (JWT) for API integration tests.

Last updated