3.2.0 • Published 12 months ago
@bryter_io/custom-actions v3.2.0
Custom Actions Metadata
This library provides types and json schema for working with and validating custom action metadata.
Read more about Custom Actions on the developer portal.
Usage
Define the metadata for a Custom Action:
import { CustomActionMetadata } from '@bryter_io/custom-actions'
const metadata: CustomActionMetadata = {
key: 'echo-action',
developerEmail: 'developer@example.com',
name: 'Echo action',
description: 'Takes a string and returns it',
parameters: [{
type: 'text',
name: 'Input string',
description: 'Text to echo back'
}],
result: {
type: 'text',
description: 'Text echoed back'
}
}
You can find more code samples on the developer portal.
Installing
npm install --save @bryter_io/custom-actions
💪 Working locally
🔬 Testing 🧪
npm test
npm run lint
Validating the JSON schema
The JSON schema for validating custom action metadata is available in the custom-actions-schema.json
file. This file is used by the API to validate the metadata sent to the backend.
Validating a single file locally can be done through the command line:
# validate JSON schema
npm run validate-metadata ./path/to/file.json
💡This command requires having npx installed globally.