This app is an example integration, built with Next.js.
It shows:
code
for an access_token
to interact with the APICreate a new integration on the integration console
Set the Redirect URL to http://localhost:3000/callback
Set the environment variables:
cp .env.local.example .env.local
Set the CLIENT_ID
and CLIENT_SECRET
accordingly to the values you see in the integration console if you edit your integration.
npm install
npm run dev
Now your example integration is running on http://localhost:3000
. Click on "View in Marketplace" to see your integration with all details like others will see it. You're now able to add your integration to a project. Once you click "add" you see a popup that will use the defined Redirect URL http://localhost:3000/callback
. The integration is now installed.
code
: The authorization code to receive an access_token
in order to interact with the APIteamId
: The id of the team (only provided if the integration gets installed on a team)configurationId
: The id of the installation (you usually want to store this information)next
: The URL we're redirecting if the setup is done/setup
we exchange the provided code
for an access_token
. See the docs for exchanging code for an access token
code
was exchanged, we can use the access_token
for our calls to the Vercel API. See the docs for available endpoints. In this case we're querying the Projects endpoint to get a list of all projects for the user or the teamImportant note:
Please make sure, that you provide the teamId
as a query parameter while interacting with the API. To determine if you have to add a teamId
to API calls, see the response after exchanging the code
for an access_token
. See the docs for accessing resources owned by a team.