Getting started
Create an account
To start using websemaphore, please sign up with your email.
Create an ApiKey
To request a lock, a system must have credentials. Create an API key using the API Key section of the console.
Note that the full key is only shown once during creation. Ideally, store it in a secret store. In any case have a way to provide the key into the calls as shown next.
Install the client library
Depending on your use case you will be using HTTPS, Websockets or both.
HTTP/Rest
When using https, the init, process and release steps may all be happening in different invocations. In a real-life scenario they could be also occuring in different systems. We are using expressjs-like syntax to emphasize this is about http endpoints. The same code would work in a serverless context such as AWS lambda.
Websockets
Due to their connected nature, it's even easier with websockets. There is no need for a webhook and the flow may be performed in a single thread.
For more details, proceed to the setup section.
Links
- WebSemaphore examples repo on GitHub
- WebSemaphore package on npm