sanity-plugin-vimeo
v1.5.5
Published
Fetch Vimeo videos using the Vimeo API to get file metadata and playback links for integration within your front-end environment.
Downloads
5
Readme
sanity-plugin-vimeo
This is a Sanity Studio v3 plugin.
Installation
npm install sanity-plugin-vimeo
Config
Add your Vimeo Access Token and/or your Vimeo User ID to your .env
VIMEO_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
VIMEO_USER_ID="YOUR USER ID"
Add it as a plugin in sanity.config.ts
(or .js):
import {defineConfig} from 'sanity'
import {vimeoField} from 'sanity-plugin-vimeo'
export default defineConfig({
//...
plugins: [
vimeoField({
accessToken: process.env.VIMEO_ACCESS_TOKEN,
userID: process.env.VIMEO_USER_ID, // Optional to alter the query to a specific user (typically your own)
}),
],
})
Usage
// … your schema
defineField({
title: 'Vimeo',
name: 'vimeo',
type: 'vimeo',
// Optional: Extend the default fields, see below for more information
options: {
fields: ['metadata'],
},
})
Options
By default the plugin stores the fields name, pictures, files and link, but you can extend (not overwrite) the fields through the options. Please be sure to add fields as an array of strings. See the vimeo response documentation for a list of available fields.
License
MIT © Dan Gavin