This is a Sanity Studio v3 plugin.
npm install sanity-plugin-vimeo
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)
}),
],
})
// … your schema
defineField({
title: 'Vimeo',
name: 'vimeo',
type: 'vimeo',
// Optional: Extend the default fields, see below for more information
options: {
fields: ['metadata'],
},
})
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.
MIT © Dan Gavin