Coder Social home page Coder Social logo

m3o / m3o-js Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 3.0 2.6 MB

JS/TS client for accessing M3O APIs

Home Page: https://www.npmjs.com/package/m3o

License: Apache License 2.0

TypeScript 98.86% JavaScript 1.14%
api email geocoding javascript javscript m3o node nodejs sms typescript weather

m3o-js's Introduction

M3O License

Serverless Micro Services

Overview

M3O transforms public APIs into smaller easier to use Micro services which you can explore, discover and consume as serverless building blocks. The platform generates unified api docs, client libraries and examples using protobuf to OpenAPI conversion and some custom tools.

Features

Here are the main features:

  • 1️⃣ ONE Platform - Discover, explore and consume public APIs all in one place.
  • ☝️ ONE Account - Manage your API usage with one account and one token.
  • ⚡ ONE Framework - Learn, develop and integrate using one set of docs and libraries.

Services

Here are a few APIs:

  • Apps - Serverless app deployment
  • Cache - In-memory data storage
  • Database - Serverless postgres database
  • Events - Push event notifications
  • Users - Account management and authentication
  • Space - Infinite cloud storage

Getting Started

  • Head to m3o.com and signup for a free account.
  • Browse services on the Explore page.
  • Call any service using your token in the Authorization: Bearer [Token] header
  • All services are available through one API endpoint: https://api.m3o.com/v1/*.
  • Use m3o-cli, m3o-js and m3o-go clients for development

Quick Start

Grab your API token from the dashboard and export it

export M3O_API_TOKEN=xxxxxxx

Curl

curl "https://api.m3o.com/v1/db/Create" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $M3O_API_TOKEN" \
  -d '{
    "table": "notes",
    "record": {
      "name": "TODO",
      "list": ["eat", "sleep", "repeat"]
    }
  }'

Find all the curl examples in m3o-sh

Go

Import packages from go.m3o.com

import (
        "go.m3o.com"
        "go.m3o.com/db"
)

Create a new client with your API token and call it

client := m3o.New(os.Getenv("M3O_API_TOKEN"))
rsp, err := client.Db.Create(&db.CreateRequest{
        Table: "notes",
        Record: map[string]interface{}{
                 "name": "TODO",
                 "list": []string{"eat", "sleep", "repeat"},
        },
})
fmt.Println(rsp, err)

Find all the Go examples in m3o-go

JS

Install the m3o package

npm install m3o

Call app run like so

const m3o = require("m3o").default(process.env.M3O_API_TOKEN);

async function main() {
  let rsp = await m3o.db.create({
    table: "notes",
    record: {
      "name": "TODO",
      "list": ["eat", "sleep", "repeat"]
    }
  });
  console.log(rsp);
}

main();

Find more JS examples in m3o-js

CLI

Install the cli

curl -fssl https://install.m3o.com/cli | /bin/bash

Example call

m3o db create --table=notes --record='{"name": "TODO", "list": ["eat", "sleep", "repeat"]}'

See the m3o-cli for examples

Deployment

  1. See Cloud for Infrastructure deployment
  2. See Platform for Micro deployment
  3. See API for Backend deployment
  4. See Web for Web deployment

m3o-js's People

Contributors

asim avatar crufter avatar cyb3rko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

m3o-js's Issues

Add ability to take voice notes

Text typing can be quite an effort on mobile. The ability to do voice to text or voice notes would make things much easier.

Type 'Stream' is not generic

> tsc

node_modules/m3o/event/index.d.ts:5:47 - error TS2315: Type 'Stream' is not generic.

5     consume(request: ConsumeRequest): Promise<m3o.Stream<ConsumeRequest, ConsumeResponse>>;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.