Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/app-action-utils

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/app-action-utils

Utilities for intearcting with Hosted App Actions

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.2K
decreased by-57.75%
Maintainers
0
Weekly downloads
 
Created
Source

Utils package for App Actions

This repo is a growing collection of utils for interacting with App Actions

Installation

npm install --save @contentful/app-action-utils
# or
yarn add @contentful/app-action-utils

Available features

Right now it only supports calling the app action and retrieving the result. This consist of:

  • Calling app actions
  • Getting an app action result
  • Polling, retrying and parsing of the details call

Requirements

When passing the plain client generated from contentful-management, it has to have org, space and environment set as defaults. If not you can pass in the spaceId and environmentId to each of the methods.

Usage

Calling an app action and getting the result

To call an app action and get the result callAppAction can be used like this

import { createClient } from 'contentful-management'


const api = createClient({
    accessToken: '<token>'
}, {
    type: 'plain'
})

const parameters: AppActionCategoryParams<'<appActionCategory>'> = {} // The parameters the app action expects, when the generic is correct it will be fully typed
const abortController = new AbortController()
const additionalParameters = {
    spaceId: '<spaceId>',
    environmentId: '<environmentId>'
}

const appActionResult = await callAppAction({
    api,
    appActionId: '<appActionId>',
    appDefinitionId: '<appDefinitionId>',
    parameters, 
})

Getting the result of a previous call

const appActionResult = await callAppActionResult({
    api,
    appActionId: '<appActionId>',
    callId: '<callId>',
    spaceId: '<spaceId>',
    environmentId: '<environmentId>'
})

FAQs

Package last updated on 30 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc