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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3b101c79af62bccdd21e145c5e4cd44fdd968eac94a53b94ceb5900b8433bf7 |
|
MD5 | 8cc5db646a5a57a1c41f81a8618bd2ab |
|
BLAKE2b-256 | eedea2724f6edca5574f071ffbc42c05613ef535863f25ebb7fe84d300cf162b |
Close
Hashes for cloudcomponents.cdk_contentful_webhook-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c01d53cd37526109538b40afd992775a11a7ce86cfa571d9437b7f6144835fd |
|
MD5 | fc11a61e0b8be570b3dadc4cae513521 |
|
BLAKE2b-256 | 1f4ed29f20e97c694999d89d74b4cdecdde534d046643a216e8960bc43a32fb8 |