Gyazo API wrapper made in TypeScript. *For now, only upload feature.

Overview

wrap-gyazo

Gyazo API wrapper made in TypeScript.
*For now, only upload feature.

Installation

npm i wrap-gyazo

Register an application with Gyazo.

Authorize (Optional)

*If you want to get an access token for each user.

  1. Get client_id, secret_id and Callback URL in Gyazo Applications.
  2. Generate a link for approval.
import {GyazoAdmin} from 'wrap-gyazo';
const gyazoAdmin = new GyazoAdmin({
  clientId:"***************",
  redirectUri:"***************",
  clientSecret:"***************"
});
const authUrl = gyazoAdmin.makeAuthorizeURL();
/**
 * authUrl = {url:string,state:string}
 */

【Optional】 Please use the "state" parameter to prevent CSRF.
*The "state" parameter is uuidv4.

  1. The user accesses the generated URL and approves the app.
    1. Get the "code" and "state" parameters from the callback URL.
    2. 【Optional】 Check the state parameter.
    3. Get "access_token" from "code".
    const accessToken =  await gyazoAdmin.getAccessToken(code);

Upload

Preparation

  1. Get the user access token or the application access token.
  2. Load an image data.

Upload to Gyazo

//base64
const uploadRes = await gyazoAdmin.uploadBase64(accessToken,base64);
//buffer
const uploadRes = await gyazoAdmin.uploadBuffer(accessToken,imageData,"png")

*You can't upload from a browser, because of the CORS policy

Others

File/Blob->Base64 Conversion (Browser Only)

import {readAsDataURL} from 'wrap-gyazo';

const base64 = await readAsDataURL(file);

Thanks for the Reference

Pull Request

If you want to add a feature, please submit a pull request.

You might also like...

🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.

🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.

file-upload-with-preview 🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well

Dec 26, 2022

A Roblox OpenCloud API wrapper for Deno (and NodeJS) written in TypeScript.

Active Development This module is currently in active development. Nothing is going to stay consistent as it reaches a stable release. Dynablox Docs |

Oct 28, 2022

A full NodeJS sms-activate.org api wrapper up to date in Typescript

Sms-Activate.org This package fully supports all the https://sms-activate.org/ API with Typescript types. Installation Install the package using npm

Dec 26, 2022

This is a simple script to upload Multiple files into google drive using google drive API and Nodejs.

Welcome to gDrive Multiple File Upload 👋 This is a simple script to upload Multiple files into google drive using google drive API and Nodejs Install

Dec 29, 2021

You can control the vibration capability of your device using the Vibration API. (JavaScript) This feature can useful in SPA and PWA.

Vibration Web API You can control the vibration capability of your device using the Vibration API. (JavaScript) This feature can useful in SPA and PWA

Mar 29, 2022

In this project we build a TVSeries website using Javascript, HTML, CSS and the TVMAze API. Each movie list on the page has a like and comments feature

MicroFLIX This project is a development about TV series, we fetched all data from TVmaze API, Users can like movies and also give a comment. All data

Jul 25, 2022

An ADB wrapper made in node js. For mobile debugging

Adb-Wrapper An awesome ADB wrapper made in node js to use adb just with functions. · Report Bug · Request Feature Table of Contents About The Project

Dec 17, 2022

An open source API wrapper for TechHost API.

TechHost API Wrapper An open source API wrapper for TechHost API. Badges Installation Install techhost-api-wrapper with npm. npm install techhost-api-

Jun 23, 2022

News API Wrapper for Violetics API News

News API Wrapper for Violetics API News

Mar 23, 2022
Releases(v1.0.3)
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
They stole our free learn feature, so it's now time for an open source variant

Quizletbutfree This project was generated using Nx. ?? Smart, Fast and Extensible Build System Quick Start & Documentation Nx Documentation 10-minute

zerxal 2 Nov 13, 2022
Upload or Upload & Publish your bundle (apk or aab) to Huawei AppGallery with ConnectApi

appgallery-publisher Upload/Publish your bundle (apk or aab) to AppGallery automatically with appgallery-publisher Usage Single Javascript File Bash F

Mustafa Yiğit 17 Sep 19, 2022
A showcase of problems once hard or impossible to solve with CSS alone, now made trivially easy with Flexbox.

Solved by Flexbox A showcase of problems once hard or impossible to solve with CSS alone, now made trivially easy with Flexbox. View Site Viewing the

Philip Walton 13k Jan 2, 2023
A website made using ReactJS library which displays all the best selling books of 2021 and a feature to check them on amazon.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Sumanth Krishna 3 Dec 30, 2021
This application provides the CDK project and a frontend that allows you to build a serverless chat application based on API Gateway's WebSocket-based API feature.

Serverless chat application using ApiGateway Websockets This project lets you provision a ready-to-use fully serverless real-time chat application usi

AWS Samples 60 Jan 3, 2023
🌈 GitHub following, followers, only-following, only-follower tracker 🌈

github-following-tracker GitHub following, followers, only-following, only-follower tracker ?? Just enter your GitHub name and track your followings!

Youngkwon Kim 10 Jun 15, 2022
🌌 Fast, in-memory, full-text search engine written in TypeScript. Now in beta.

Installation You can install Lyra using npm, yarn, pnpm: npm i @nearform/lyra yarn add @nearform/lyra pnpm add @nearform/lyra Usage Lyra is quite simp

NearForm 5.1k Dec 30, 2022