An open API service indexing awesome lists of open source software.

https://github.com/raxjs/universal-api

Universal apis for web and miniapps.
https://github.com/raxjs/universal-api

mini-program miniapp rax universal-apis wechat wechat-mini-program

Last synced: 9 months ago
JSON representation

Universal apis for web and miniapps.

Awesome Lists containing this project

README

          



Rax


Uni API is a cross-terminal API solution that supports applets and web containers.

---

๐ŸŽ‰ **Multi-container support** Currently supports Web, WeChat Mini Programs, Toutiao Mini Programs, Ali Mini Programs, Baidu Smart Programs and Kuaishou Mini Programs
๐Ÿ‚ **Rich API** Cover 90+ API implementations
๐Ÿ˜ฏ **Complete documentation** Provide bilingual documents and rich samples
0๏ธโƒฃ **No framework dependency** No framework dependency, pure native implementation, compatible with any framework
๐Ÿš€ **Extreme volume** Support on-demand loading, eliminate useless code according to the environment
๐Ÿ‘๐Ÿป **Easy to use, fast access** Provide a complete Typescripts statement, so you can get rid of the documentation and immerse yourself in programming

## Quick start

> Take @uni/toast as an example

```bash
$ npm install @uni/toast
```

```js
import { showToast } from '@uni/toast';

// string
showToast('Hi');

// object
showToast({
content: 'hello',
type: 'success',
duration: 1000,
success: () => {
console.log('toast')
}
});

// promise
showToast({
content: 'hello',
type: 'success',
duration: 1000,
}).then(() => {});
```

## Docs
Official site: [https://universal-api.js.org/](https://universal-api.js.org/)

## Example






Wechat MiniProgram






Alibaba MiniApp


## Contribute code
Please read [Rax Contribution Code Guide](https://github.com/alibaba/rax/wiki/CONTRIBUTING), Understand the basic specifications.

### Get started

```
$ git clone git@github.com:raxjs/universal-api.git
$ npm install
$ npm run build
```

### Debug API
Take @uni/toast as an example:

```
$ npm run build toast
$ npm run build:demo
$ cd demos
$ npm i
$ npm run start # ๅฏๅŠจ้กน็›ฎ๏ผŒๆ‰“ๅผ€ๅฐ็จ‹ๅบ IDE ่ฟ›่กŒ่ฐƒ่ฏ•
```

## Protocol

[BSD License](https://github.com/raxjs/miniapp/blob/master/LICENSE)