Notion SDK for JavaScript A simple and easy to use client for the Notion API Installation npm install @notionhq/client Usage Use Notion's Getting Started Guide to get set up to use Notion's API. Import and initialize a client using an integration token or an OAuth access token. const { Client } = require ( "@notionhq/client" ) // Initializing a client const notion = new Client ( { auth : process . env . NOTION_TOKEN , } ) Make a request to any Notion API endpoint. See the complete list of endpoints in the API reference. ; ( async ( ) => { const listUsersResponse = await notion . users . list ( { } ) } ) ( ) Each method returns a Promise which resolves the response. console . log ( listUsersResponse ) { results: [ { object: 'user', id: 'd40e767c-d7af-4b18-a86d-55c61f1e39a4', type: 'person', person: { email: ' avo@example.org ', }, name: 'Avocado Lovelace', avatar_url: ' https://secure.notion-static.com/e6a352...
Comentarios
Publicar un comentario