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.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88440ee3802f12c7e93b44728773ff3092378bc13422c2c3d5771169fa76adc |
|
MD5 | 502195f7126cad45c33b9cb8a4ebb7cc |
|
BLAKE2b-256 | ee9008829f7b06a48e59f39720fe8fd909b4d6de2a1676195f3736ef18759894 |
Close
Hashes for cloudcomponents.cdk_contentful_webhook-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4acf88279d7de1f56150f6044c5f587afe3b998915240799675f95510a4aa655 |
|
MD5 | 016d158660bdf22a4ef0d1f36c9b6458 |
|
BLAKE2b-256 | 47dff94c12899e741790c804288962c6d72c7223455bd2aa6530bd9269bcd574 |