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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c8015b1ead48b977174b37029ae84f11d17d24c28d6e8df18d1b04fc1aa253 |
|
MD5 | abea99c869a3eba3a23d809e8e5f9bc9 |
|
BLAKE2b-256 | 2430fb4af1a470a5300ac5ef6a4093fdda12fb36179bea005568171acea7fb98 |
Close
Hashes for cloudcomponents.cdk_contentful_webhook-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f67dd2f985b6c19f3f55287beac72afb29174049a42d9deb4450c287f59a43cd |
|
MD5 | d2e6cacc1217a12ac1e1cca0eeb8f834 |
|
BLAKE2b-256 | 136990c8692a408db91a4734f317b366dfa30a7d4aa4a4b40e47827597589d16 |