Skip to content

SecNex/notion-webhook-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notion Webhook Server

This is a simple python package to create a webhook server that can be used to handle Notion webhooks and trigger actions.

Installation

pip install secnex-notion-webhook-server

Usage

Create a new webhook server with only the webhook handler

from notion_webhook.server import WebhookServer

server = WebhookServer()
server.start()

Create a new webhook server with a custom handler

from notion_webhook.server import Server, Handler, WebhookHandler
from notion_webhook.db import TokenDatabase

db = TokenDatabase()

if db.check_first_run():
    token_id, token = db.create_token()
    print(token)

handler = Handler(WebhookHandler(db).webhook_handler)

handlers = {
    "/webhook": handler
}

server = Server(
    addr=os.getenv("HOST", "0.0.0.0"),
    port=int(os.getenv("PORT", 8000)),
    handlers=handlers,
    app_name=os.getenv("APP_NAME", "NotionWebhookServer")
)
server.start()

You find the example in the examples folder.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For questions or support, please contact us at support@secnex.io.

About

Simple python package to create a webhook server that can be used to handle Notion webhooks and trigger actions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages