mariosimao / notion-sdk-php
A complete Notion SDK for PHP developers.
Fund package maintenance!
mariosimao
Installs: 41 749
Dependents: 2
Suggesters: 0
Security: 0
Stars: 150
Watchers: 5
Forks: 24
Open Issues: 30
Requires
- php: >=8.1
- php-http/discovery: ^1.15
- psr/http-client-implementation: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message-implementation: ^1.0
Requires (Dev)
- brianium/paratest: ^7.1
- guzzlehttp/guzzle: ^7.5
- infection/infection: ^0.26.19 || ^0.27.0
- phpunit/phpunit: ^10.0
- psalm/plugin-phpunit: ^0.18.4
- squizlabs/php_codesniffer: ^3.7
- vimeo/psalm: ^5.7
- dev-main
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- v1.0.0-beta.2
- v1.0.0-beta.1
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
- dev-dependabot/composer/php-http/discovery-1.20.0
- dev-dependabot/npm_and_yarn/docs/rollup-2.79.2
- dev-dependabot/npm_and_yarn/docs/multi-09d1b7077e
- dev-dependabot/composer/squizlabs/php_codesniffer-3.10.3
- dev-dependabot/npm_and_yarn/docs/vite-3.2.11
- dev-dependabot/composer/vimeo/psalm-5.26.1
- dev-dependabot/composer/guzzlehttp/guzzle-7.9.2
- dev-dependabot/composer/psalm/plugin-phpunit-0.19.0
- dev-docs
This package is auto-updated.
Last update: 2024-10-07 20:24:03 UTC
README
A complete Notion SDK for PHP developers.
📦 Installation
This project requires PHP 8.1 or higher. To install it with Composer run:
$ composer require mariosimao/notion-sdk-php
👩💻 Basic usage
Creating a page on Notion with the SDK is easy.
use Notion\Blocks\Heading1; use Notion\Blocks\ToDo; use Notion\Common\Emoji; use Notion\Notion; use Notion\Pages\Page; use Notion\Pages\PageParent; $notion = Notion::create("secret_token"); $parent = PageParent::page("c986d7b0-7051-4f18-b165-cc0b9503ffc2"); $page = Page::create($parent) ->changeTitle("Shopping list") ->changeIcon(Emoji::fromString("🛒")); $content = [ Heading1::fromString("Supermarket"), ToDo::fromString("Tomato"), ToDo::fromString("Sugar"), ToDo::fromString("Apple"), ToDo::fromString("Milk"), Heading1::fromString("Mall"), ToDo::fromString("Black T-shirt"), ]; $page = $notion->pages()->create($page, $content);
📄 Documentation
Further documentation can be found at https://mariosimao.github.io/notion-sdk-php.
The Notion PHP SDK supports the usage of static analysers. We strongly recommend the usage of either vimeo/psalm or phpstan/phpstan in combination with this library, to avoid simple mistakes.
🏷️ Versioning
SemVer is followed closely. Minor and patch releases should not introduce breaking changes to the codebase.
Any classes or methods marked as @internal
are not intended for use outside of this library and are subject to breaking changes at any time, avoid using them.
🛠️ Maintenance & Support
When a new minor version (e.g. 1.3 -> 1.4) is released, the previous one (1.3) will continue to receive security and critical bug fixes for at least 3 months.
When a new major version is released (e.g. 1.6 -> 2.0), the previous one (1.6) will receive critical bug fixes for at least 3 months and security updates for 6 months after that new release comes out.
This policy may change in the future and exceptions may be made on a case-by-case basis.
❤️ Sponsors
An special thanks to all sponsors who activelly support the SDK!