@webiny/api-wcp
v5.41.1
Published
A set of backend Webiny Control Panel (WCP)-related features.
Downloads
5,597
Readme
@webiny/api-wcp
A set of backend Webiny Control Panel (WCP)-related features.
Table of Contents
Installation
npm install --save @webiny/api-wcp
Or if you prefer yarn:
yarn add @webiny/api-wcp
Overview
The @webiny/api-wcp
package contains essential backend Webiny Control Panel (WCP)-related utilities.
Examples
| Example | Description | | ----------------------------------------------------------- | ------------------------------------------------------------- | | Registering Plugins | Shows how to register relevant plugins in a handler function. |
Reference
Functions
createWcpContext
export declare const createWcpContext: () => ContextPlugin<WcpContext>;
Creates the WCP context API.
import { createHandler } from "@webiny/handler-aws";
import { createWcpContext } from "@webiny/api-wcp";
export const handler = createHandler({
plugins: [
// Registers WCP context API.
createWcpContext(),
// ...
]
});
createWcpGraphQL
export declare const createWcpGraphQL: () => GraphQLSchemaPlugin<WcpContext>;
Returns WCP API URL. The default URL can be overridden via the WCP_API_URL
environment variable.
import { createHandler } from "@webiny/handler-aws";
import { createWcpGraphQL } from "@webiny/api-wcp";
export const handler = createHandler({
plugins: [
// Registers WCP context API.
createWcpGraphQL(),
// ...
]
});