Setting Up Your Codebase
First, we need to get our codebase set up, which begins with creating a Next app through the CLI.
Then, we'll cd
into the directory to make a few necessary changes.
Within the src/app
file, create a directory called api/actions
. In it, create a folder with the name of the action you want to make (eg: api/actions/donate-sol
) and put a route.ts
in that file. This is what your file directory should look like:
The route.ts
is the file that contains Action API logic. In the next few sections, we will examine this in more detail.
With that done, the next step is to install the Solana Actions SDK by running the following commands:
At the top of the route.ts
file, you need to import the following from the @solana/actions
SDK:
Congratulations! In the next section, we'll discuss the header information required to work with Actions.
Last updated