import Contentful from 'contentful-management'
type Contentful = {
accessToken: string
environment: string
spaceId: string
}
const makeClient = (resource: Contentful) => {
return Contentful.createClient(
{ accessToken: resource.accessToken },
{
type: 'plain',
defaults: { spaceId: resource.spaceId, environmentId: resource.environment }
}
)
}
export async function main(resource: Contentful, entryId: string) {
const client = makeClient(resource)
const response = await client.entry.get({
entryId
})
return response
}
Submitted by hugo697 118 days ago