Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/l-mario564/osu.js
osu.js is an unofficial Javascript and Typescript SDK for the browser-facing portion of osu! with type safety in mind.
https://github.com/l-mario564/osu.js
api-wrapper osu osu-api osu-web osugame
Last synced: 10 days ago
JSON representation
osu.js is an unofficial Javascript and Typescript SDK for the browser-facing portion of osu! with type safety in mind.
- Host: GitHub
- URL: https://github.com/l-mario564/osu.js
- Owner: L-Mario564
- License: mit
- Created: 2023-01-29T17:45:47.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-13T03:19:51.000Z (4 months ago)
- Last Synced: 2024-10-14T09:27:35.884Z (23 days ago)
- Topics: api-wrapper, osu, osu-api, osu-web, osugame
- Language: TypeScript
- Homepage: https://osujs.mario564.com
- Size: 780 KB
- Stars: 20
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
## About
[osu.js](https://osujs.mario564.com) is an unofficial Javascript and Typescript SDK for the browser-facing portion of [osu!](https://osu.ppy.sh/home) with type safety in mind.
**Why this API wrapper?**
- Extremely lightweight (less than 6kb when minified + gzipped).
- Supports both versions of the API.
- Every response from the APIs are fully typed.
- Handles errors in a developer-friendly way.
- Fully documented in its own website.
- In addition to the API wrapping, it includes some extra utilities.## Installation
```bash
# npm
npm i osu-web.js
# yarn
yarn add osu-web.js
# pnpm
pnpm add osu-web.js
```## Quickstart
```js
import { Client, LegacyClient } from 'osu-web.js';// Client for the current API (API v2)
const client = new Client('OAUTH ACCESS TOKEN');
// Client for the legacy API (API v1)
const legacy = new LegacyClient('API KEY');// Get a user
// API v2
let v2User = await client.users.getUser(14544646, {
urlParams: {
mode: 'osu'
}
});// API v1
let v1User = await legacy.getUser({
u: 14544646,
m: 'osu'
});
```## Coverage
osu.js has 100% coverage over the legacy API.
For the current API, all documented endpoints with a `GET` request have been implemented and tested. All endpoints with `POST` and `PATCH` requests have been implemented, but most aren't tested. None of the undocumented endpoints have been implemented.
## Links
### Project
- [Documentation](https://osujs.mario564.com)
- [Github](https://github.com/L-Mario564/osu.js)
- [npm](https://www.npmjs.com/package/osu-web.js)### Other
- [Legacy API Documentation](https://github.com/ppy/osu-api/wiki)
- [Current API Documentation](https://osu.ppy.sh/docs/index.html)## Contributing
Read [CONTRIBUTING.md](https://github.com/L-Mario564/osu.js/blob/master/CONTRIBUTING.md)