How to use the tinacms.cms.registerApi function in tinacms

To help you get started, we’ve selected a few tinacms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinacms / tinacms / packages / demo-next / pages / _app.js View on Github external
// }

  render() {
    const { Component, pageProps } = this.props
    return (
      
        
      
    )
  }
}

export default MyApp

// Duplicated from gatstby-tinacms-git
cms.registerApi('git', {
  onSubmit(data) {
    return commit(data)
  },
  onChange(data) {
    writeToDisk(data)
  },
  onUploadMedia(data) {
    writeMediaToDisk(data)
  },
  onDelete(data) {
    deleteFromDisk(data)
  },
  isAuthenticated() {
    return true
  },
})