notion-sdk-php
A complete Notion SDK for PHP developers.
Installation
composer require mariosimao/notion-php
Getting started
A Notion token will be needed to fully use this library. If you don't have one, please refer to Authorization section from the Notion API documentation.
A simple example on how to create a page with some content:
use Notion\Client;
use Notion\Blocks\Paragraph;
use Notion\Pages\Page;
use Notion\Pages\PageParent;
$token = getenv("NOTION_TOKEN");
$client = Client::create($token);
$parent = PageParent::page("c986d7b0-7051-4f18-b165-cc0b9503ffc2");
$page = Page::create($parent)
->withTitle("Sample page")
->withIcon("⭐");
$content = Paragraph::fromString("This is a simple paragraph.");
$client->pages()->create($page, $content);
Documentation
Further documentation can be found here.