npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@anime-skip/api-client

v2.6.2

Published

GraphQL client for interacting with the Anime Skip API

Downloads

7

Readme

Typescript API Client

A simple, axios based API client that ships with types and powers all of Anime Skip!

This library is generated based on the current introspection result from test.api.anime-skip.com.

echo "@anime-skip:registry=https://npm.pkg.github.com/" >> .npmrc
npm i @anime-skip/api-client

This is an alternative to Apollo or any other GraphQL client library out there! Use something else if you prefer

Contributing

See the contributing guidelines for all of Anime Skip

Usage

To call the api, you need a client id! Checkout the API docs to get one. The one used below is a shared one that anyone can use, but it is heavily rate limitted.

import { createAnimeSkipClient } from '@anime-skip/api-client';
import md5 from 'md5';

// Create the client

const baseUrl = 'https://test.api.anime-skip.com/';
const clientId = 'ZGfO0sMF3eCwLYf8yMSCJjlynwNGRXWE';
const client = createAnimeSkipClient(baseUrl, clientId);

// Call the API

const { authToken } = await client.login(`{ authToken }`, {
  usernameEmail: 'username',
  passwordHash: md5('password'),
});

// Access the axios instance to add interceptors, retries, etc

client.axios;

The methods exposed on the client match the queries and mutation names used in the graphql. For documentation checkout the api playground! Types are also included as named exports all prefixed with Gql. Extend them, pick from them, or use them directly, whatever you prefer!

import { GqlAccount, GqlEpisode, GqlCreateTimestampArgs, ... } from '@anime-skip/api-client';

E2E Tests

This is where the E2E tests of the API are located. They test both the API and this client library. Contributers should know how to run and update them, but making changes to the backend is not possible because it is private.

If you think there's a problem with the API, head over to the support page to get help: https://www.anime-skip.com/support

All tests are ran inside a local docker environment. To start them, run the following command:

pnpm test:e2e

Between each test suite (file), the database is reset. So if you create a new test suite, make sure you initialize test data and accounts within that file

Tests are orchestrated by e2e/index.ts. It spins the docker environment, runs the jest test suite, and stops docker.

Backend Devs Only

To run the tests against a development version of the api service, first build the dev image, then run the dev tests script

cd /path/to/api-service
make
cd /path/to/this/project
pnpm test:e2e:dev