Metadata-Version: 2.4
Name: secnex_notion_webhook_server
Version: 0.0.3
Summary: A package to create a webhook server that can be used to handle Notion webhooks and trigger actions
Author-email: Björn Benouarets <bjoern@secnex.io>
License-Expression: MIT
Project-URL: Homepage, https://github.com/secnex/notion-webhook-server
Project-URL: Issues, https://github.com/secnex/notion-webhook-server/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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

```bash
pip install secnex-notion-webhook-server
```

## Usage

### Create a new webhook server with only the webhook handler

```python
from notion_webhook.server import WebhookServer

server = WebhookServer()
server.start()
```

### Create a new webhook server with a custom handler

```python
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](examples) folder._

## License

This project is licensed under the MIT License. See the [LICENSE](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](mailto:support@secnex.io).
