Comment on page
Get started: Dapp
On Permissive, a dApp or operator refers to the entity that uses Permissive not to grant permissions as a user but to request permissions from users and use them to interact on behalf of users' accounts. In the contracts, an operator is a signer with a private key that signs UserOperations to send transactions from the user's account. From the user's perspective, an operator can be a website, application, game, or any other entity that requests permission to interact with the account.
As an operator, you will need to set up a backend that is responsible for processing the specified user operations. This backend will communicate with a bundler using an API key. To address this, you can use our SDK and API, which allows you to handle all Permissive related actions. When requesting user Permissions we advise you to redirect to our website, so you don't need to build the whole permission granting page for user's transparency. It's important for your frontend to take this into consideration.
To give you a more detailed understanding of how a service interacts with Permissive, we have created a small farming game website and a complete tutorial explaining how to build it. The project is a farming game where users harvest wheat tokens. Each time they harvest, they earn some wheat based on the last time they harvested. In the example project, we demonstrate the process of creating an account, funding it for gas, and asking the user for permission to harvest on their behalf. Once the permissions are granted, the backend exposes an API endpoint called "harvest" that can be used to harvest for the owner. You can set up a CRON job to automate this process. For simplicity, the demo is made for one owner, so you will need to edit the .env file if you want to use it for multiple owners.
Here is the example repo, there are two projects in it:
- 1.The contracts with the foundry framework
- 2.The client and api with NextJs and Vercel