Skip to content

specklesystems/webhooks-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

speckle-webhooks-example

This is a simple example of what you can do using Speckle Stream Webhooks.

Requests from the Speckle Server are consumed and formatted to then be sent to Discord:

example-messages stream-update-example commit-update-example

Setup

You'll need access to a Speckle Server (or use our public one, speckle.xyz). Create some webhooks on the server to get started.

create-webhook

Fill in your .env file based on the .env-example:

  • SECRET: the secret you used to set up the webhooks. note that it is assumed that all your webhooks have the same secret
  • SPECKLE_TOKEN: (optional) you can generate this from your profile online. this is only used for the commit_created event
  • DISCORD_URL: generate this by going to a discord channel's settings > integrations > webhooks > new webhook

generate discord webhooks url

Developing

Dependencies

This project uses poetry for package management. Follow the docs to install.

If this is your first time using poetry and you're used to creating your virtual environments within the project directory, run $ poetry config virtualenvs.in-project true to configure poetry to do the same.

To bootstrap the project environment run $ poetry install. This will create a new virtual-env for the project and install both the package and dev dependencies.

If you don't want to use poetry, you can roll your own virtual env and install the specified dependencies in the pyproject.toml.

Start

To start up, simply run the run.py file in the root directory.