Your Lairs have exclusive access to the WayScript SDK, which offers a the following packages to help with tool development:
wayscript.context
- access process execution metadata, such as event payloadwayscript.triggers
- call trigger-specific methodswayscript.secret_manager
- update secrets in your vault
from wayscript import context
Method | Description | Parameters | Return Type |
---|---|---|---|
context.get_event() | Get request event payload | <none> | dict |
context.get_lair() | Get Lair name | <none> | dict |
context.get_lair_trigger() | Get trigger name | <none> | dict |
context.get_lair_url() | Get default lair endpoint | <none> | str |
context.get_process() | Get process id | <none> | dict |
context.get_user_by_application_key( <application_key>) | Get metadata for workspace member from application key | application_key : str | dict |
context.get_workspace() | Get Workspace name | <none> | dict |
{% hint style="info" %}
The get_user_by_application_key
method requires fetching the application key from the header of the request made to your Lair. We provide an example on how to access the request header in your tool.
{% endhint %}
import wayscript.triggers as triggers
Method | Description | Parameters | Return Type |
---|---|---|---|
triggers.http_trigger.send_response(data, headers, status_code) |
Return response to endpoint generated by |
|
dict |
from wayscript import secret_manager
Method | Description | Parameters | Return Type |
---|---|---|---|
secret_manager.set_secret(<key>, <value>) | Set the value of a lair secret |
| None |
const wayscript = require("wayscript");
Method | Description | Parameters | Return Type |
---|---|---|---|
context.getEvent() | Get event payload | <none> | object |
context.getLair() | Get Lair name | <none> | object |
context.getLairTrigger() | Get trigger name | <none> | object |
context.getLairUrl() | Get default lair endpoint | <none> | string |
context.getProcess() | Get process id | <none> | object |
context.getUserByApplicationKey(<application_key>) | Get metadata for workspace member from application key | application_key : string | object |
context.getWorkspace() | Get Workspace name | <none> | object |
{% hint style="info" %}
The getUserByApplicationKey
method requires fetching the application key from the header of the request made to your Lair. We provide an example on how to access the request header in your tool.
{% endhint %}
wayscript.http_trigger
Method | Description | Parameters | Return Type |
---|---|---|---|
http_trigger.sendResponse(data, headers, status_code) |
Return response to endpoint generated by |
|
object |
Method | Description | Parameters | Return Type |
---|---|---|---|
secret_manager.setSecret(<key>, <value>) | Set the value of a lair secret |
| undefined |
{% hint style="warning" %} We are working on creating a Go SDK. In the meantime, code snippets for common WayScript methods can be found here: https://github.com/wayscript/wayscript-golang {% endhint %}