Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@vtex/api
Advanced tools
This library enables developers to quickly integrate with the VTEX IO APIs and create full fledged node services using VTEX IO.
For a complete example on using @vtex/api
, check out this app: https://github.com/vtex-apps/service-example
The most basic usage is to export a new Service()
with your route handlers:
// Import global types
import './globals'
import { Service } from '@vtex/api'
import { clients } from './clients'
import example from './handlers/example'
// Export a service that defines route handlers and client options.
export default new Service({
clients,
routes: {
example,
},
})
This allows you to define middlewares that receive a Context
param which contains all IO Clients in the clients
property:
export const example = async (ctx: Context, next: () => Promise<void>) => {
const {state: {code}, clients: {apps}} = ctx
console.log('Received code:', code)
const apps = await apps.listApps()
ctx.status = 200
ctx.body = apps
ctx.set('Cache-Control', 'private')
await next()
}
ctx.clients.apps
is an instance of Apps
.
Install the dependencies (yarn
) and run yarn watch
.
FAQs
VTEX I/O API client
The npm package @vtex/api receives a total of 4,658 weekly downloads. As such, @vtex/api popularity was classified as popular.
We found that @vtex/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.