Prerequisites
- Created your Unkey account
- Created an Unkey root key with
ratelimit.*.create_namespace
andratelimit.*.limit
permissions.
Creating an express server
1
Create express application
First run the following:Then update your package.json to have the following
2
Install
Now install the
@unkey/ratelimit
package3
Add Root Key to env
Add your root key to your
.env
file4
Creating the server
Create a file called
server.ts
and add the following codeserver.ts
5
Running the server
6