👨‍💻
DIY Portfolio
  • 👨‍💻DIY Portfolio
  • 🚚Deployment Guide
  • ⚙️Configuring `data.json`
  • 🔗Example social links
  • 🔐Creating env variables
  • 🆕PR Guidelines
Powered by GitBook
On this page
  • Introduction
  • Creating a Notion Account
  • Creating NOTION_API_KEY env variable
  • Creating NOTION_DB_ID env variable
  • Creating NOTION_USER_ID env variable

Creating env variables

Steps to create the environment variables needed for the functioning of the contact form and the backend edge function.

PreviousExample social linksNextPR Guidelines

Last updated 1 year ago

Introduction

The contact page on the website is connected to an edge function that requires three env variables - NOTION_API_KEY, NOTION_DB_ID, NOTION_USER_ID to store the contact enquiries and notify you about the enquiries.

Follow the steps below to create the env variables and then paste them in your deployment settings as described in the deployment documentation.

Creating a Notion Account

  1. Go to

  2. Create your account by clicking on Get Notion free.


Creating NOTION_API_KEY env variable

  1. Navigate to and login with your notion account.

  2. Click “View my integrations”.

  3. Click “New integration”

  4. Give the integration a name of your choice.

  5. Click submit.

  6. Click “Capabilities”

  7. Click “Read user information without email addresses”

  8. Click “Save changes”

  9. Go back to “Secrets”

  10. Click on “Show” and then “Copy”

  11. This secret is your NOTION_API_KEY value. Paste it in your deployment environment variables.


Creating NOTION_DB_ID env variable

  1. Create a new page, with a table.

  2. Create a new data source by entering the name and clicking on new database in the next page as shown below.

  3. Change the heading of the 'Name' column to 'Subject'. This is the title column for the new pages.

  4. Delete the Tags column.

Property
Type

Name

Text

Email

Email

Message

Text

Date

Date

Mention

Person

The final table should look similar to the below table.

  1. Click on more and then Add Connections → select the integration you created → Confirm. This step is mandatory to allow the integration to fill the data in the table.

  2. Then open the table in a new view.

  3. Copy the URL of the opened table. It should look as follows:

    https://www.notion.so/username/87e015e43e7f4c9ebb6fb9612f644556?v=<VIEWID>

  4. The ID after username/ and before ?v= is the NOTION_DB_ID. Paste it in your deployment environment variables.


Creating NOTION_USER_ID env variable

  1. Paste https://api.notion.com/v1/users in the URL field.

  2. Click on the Headers tab and paste Notion-Version: 2022-06-28.

  3. Click Send.

  4. Copy the ID of the user that matches with your name, not the integration name. Verify that the type is person and not bot.

  1. This copied ID is your NOTION_USER_ID.

Go to and login with your Notion account.

Add the following new columns by clicking on the plus button.

Navigate to

Go to Authorization tab and paste your in the Token field.

🔐
https://notion.so
https://reqbin.com/
NOTION_API_KEY
https://notion.so
https://developers.notion.com/
Creating a new page
Adding a table to the new page
Final Enquiries Table