Skip to main content

Indent Next.js Quickstart

Learn how to submit your first approval request using Next.js and Indent Approval Kit.

Prerequisites

1. Install

Start by creating your Next.js application:

npx create-next-app -e with-indent indent-approvals

For existing projects, install the Indent JavaScript SDK:

npm install --save @indent/approvals

2. Get your API Key

First, you'll need an Indent space and API token which you can find here: indent.com/api-keys

Current User
Sign in to get API key
  • Can take actions on your behalf
  • Appears in audit log as you
Indent Space
Access Token
Note: this token is short lived and will expire soon
.env
INDENT_SPACE=
INDENT_API_TOKEN=************************************************************************************

The INDENT_SPACE is the Indent account you want to use for requests and an INDENT_API_TOKEN which is used for authentication. There are two kinds of API tokens: short-lived user access tokens and long-lived service account tokens. Read more about API authentication.

3. Try it for yourself

You can run the following command to start your Next.js app:

npm run dev

Open localhost:3000 with your browser to see the app and try creating a request using your API key. Here's a deployed version of what that looks like:

https://indent-approvals.vercel.app

Screenshot of end-to-end Indent API example with Next.js