Create, update and delete contentful webhooks with your app deployment
Project description
@cloudcomponents/cdk-contentful-webhook
Create, update and delete contentful webhooks with your app deployment
Install
TypeScript/JavaScript:
npm i @cloudcomponents/cdk-contentful-webhook
Python:
pip install cloudcomponents.cdk-contentful-webhook
How to use
import { ContentfulWebhook } from '@cloudcomponents/cdk-contentful-webhook';
import { SecretKey } from '@cloudcomponents/cdk-secret-key';
import { Stack, StackProps, aws_apigateway } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export class ContentfulWebhookStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const api = new aws_apigateway.RestApi(this, 'Endpoint');
api.root.addMethod('POST');
if (typeof process.env.ACCESS_TOKEN === 'undefined') {
throw new Error('environment variable ACCESS_TOKEN undefined');
}
const accessToken = SecretKey.fromPlainText(process.env.ACCESS_TOKEN);
if (typeof process.env.SPACE_ID === 'undefined') {
throw new Error('environment variable SPACE_ID undefined');
}
const spaceId = process.env.SPACE_ID;
const topics = ['Entry.create'];
new ContentfulWebhook(this, 'ContentfulWebhook', {
accessToken,
spaceId,
name: 'ExampleWebhook',
url: api.url,
topics,
logLevel: 'debug',
});
}
}
API Reference
See API.md.
Example
See more complete examples.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cloudcomponents.cdk-contentful-webhook-2.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 416a459a2e5056fb6ed6038b9d1ec9a1550550f9b8733cbfec1d45078feaabbc |
|
MD5 | dfda8a42d8e269154ffc2dc312ce6cc4 |
|
BLAKE2b-256 | 1f28e3465d6f181fdf24f47aa8a5b2626a140c7bb19f230dd16b256e1947e71d |
Close
Hashes for cloudcomponents.cdk_contentful_webhook-2.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5386c6f99826681c3bfec2226cecb1b659c9bffa56b61a3b468ce368ca70b860 |
|
MD5 | 97b800d98632d600a2c8a508abe86f24 |
|
BLAKE2b-256 | da3fab1d9f92c10c725f3e88ded07ed1a02f569f001b79b1565a3ef23a9ab46f |