Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-tinacms-github

Package Overview
Dependencies
Maintainers
1
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-tinacms-github

This package provides helpers for managing the github auth token on the server. When used with Next.js in the `pages/api` directory, these functions are mapped to `/api/*` endpoints.

  • 0.0.2-canary4.0
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by84.62%
Maintainers
1
Weekly downloads
 
Created
Source

next-tinacms-github

This package provides helpers for managing the github auth token on the server. When used with Next.js in the pages/api directory, these functions are mapped to /api/* endpoints.

createCreateAccessTokenFn

Helper for creating a createCreateAccessToken server function.

Implementation

// pages/api/create-github-access-token.ts

import { createCreateAccessTokenFn } from 'next-tinacms-github'

export default createCreateAccessTokenFn(
  process.env.GITHUB_CLIENT_ID,
  process.env.GITHUB_CLIENT_SECRET
)

createProxy

Helper for creating a proxy which attaches this Github access token to the request

Implementation

// pages/api/proxy-github.ts

import { createProxy } from 'next-tinacms-github'
import { GITHUB_ACCESS_TOKEN_COOKIE_KEY } from './constants'

export default createProxy(GITHUB_ACCESS_TOKEN_COOKIE_KEY)

createPreviewFn

Helper for creating a preview function which will set the preview data from Github cookies

Implementation

// pages/api/preview.ts

import { createPreviewFn } from 'next-tinacms-github'

export default createPreviewFn(
  'fork_full_name',
  'head_branch',
  'github_access_token'
)

FAQs

Package last updated on 07 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc