Open your terminal and do mkdir notion-api-test (this will create a folder called notion-api-test) on your chosen location, and after that, step into your folder with cd notion-api-test and do npm init -y (this command will create a package.json with some basic setup and the -y flag answers to some prompts automatically so you don’t have to bother yourself with them).Īs I mentioned before, we’re going to use notion-sdk-js, and for that we need to install it as a dependency, so we’re going to do npm install open your notion-api-test on your code editor and create an initial index.js on the root and edit the package.json scripts by replacing what’s there with the following: "scripts" : , Choose it and press Invite, and your Notion setup is done. You’ll then be able to choose your newly created integration. On our newly created database, we want to press Share, then Invite. Note: at the time of writing, there doesn’t seem to be a way to delete integrations, so name them wisely. You don’t need to do anything on this page other than copying your token and press Save changes. Press Submit and you’ll be directed to a new page with an Internal Integration Token (we’ll use this on our code) and with two option boxes for where you want to use your integration. Press Create new integration, fill in your title and be sure to choose your Associated workspace (it will be chosen by default but make sure of this). If you click it, you’ll be directed to a screen showing “My integrations”, and yours will be empty, of course. You’ll see a My integrations link in the top corner. Now we’ll go to the documentation website. For this tutorial, we’ll work just with Name and Role fields, as if we’re working with a database of employees in a company. The next step is to create some columns on our database and fill them with some mock data. This will give us an empty table, which is exactly what we want! For this tutorial, we’ll choose the Table database. It has a very generous free tier and you don’t have to add any payment information!Īfter creating your account and logging in, create a new page by choosing Add a page and give it a name. If you don’t already have a Notion account, please create one by following this link. As ever, the code for the tutorial can be found on GitHub. To follow along, you’ll need a Notion account (more on that below), as well as a recent copy of Node installed on your machine. In the second, we’ll get our hands on the code by initializing a folder, adding the Notion dependency and creating the initial index.js and editing the package.json to make everything work. The first will cover the steps that we need to follow on the Notion software and API. Our setup will be split into two sections.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |