Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

skapi-js

Package Overview
Dependencies
Maintainers
0
Versions
650
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skapi-js

Skapi: Backend API for HTML frontend.

  • 1.0.186-beta.17
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
585
increased by38.63%
Maintainers
0
Weekly downloads
 
Created
Source

Skapi

Serverless backend API Library for HTML Frontend. Build fullstack web applications directly from your HTML without backend engineering.

Compatible with both vanilla HTML and SPA projects

No fancy framework or complex deployment required. Just focused on the basics, Skapi is a single JavaScript library fully compatible with vanilla HTML, as well as any frontend frameworks.

All-in-One Package

Skapi provides all the backend features you need for your web application out of the box, without the need to set up or maintain any backend servers.

  • Authentication
  • Database
  • File Storage
  • CDN
  • Automated Email Systems
  • Realtime Messaging
  • API Bridge for 3rd party API's
  • Hosting

Getting Started

1. Create a service

  1. Signup for an account at skapi.com.
  2. Log in and create a new service from the My Services page.

2. Initialize the Skapi library

Skapi is compatible with both vanilla HTML and webpack-based projects (ex. Vue, React, Angular... etc). You need to import the library using the <script> tag or install via npm.

For HTML projects:

For vanilla HTML projects, import Skapi in the script tag, and initialize the library.

<!DOCTYPE html>
<script src="https://cdn.jsdelivr.net/npm/skapi-js@latest/dist/skapi.js"></script>
<script>
    const skapi = new Skapi('service_id', 'owner_id');
</script>

Be sure to replace 'service_id' and 'owner_id' with the actual values of your service

For more information, check out our documentation.

For SPA projects:

To use Skapi in a SPA projects (such as Vue, React, or Angular), you can install skapi-js via npm.

$ npm i skapi-js

Then, import the library into your main JavaScript file.

// main.js
import { Skapi } from 'skapi-js';
const skapi = new Skapi('service_id', 'owner_id');

// Export the skapi instance, so you can use it in other components
export { skapi }

3. Test your connection

After you initialized the Skapi library, you can test your connection by pinging your request with the mock() method.

Below is an example of how you can use the mock() method in HTML forms.

<!-- index.html -->
<!DOCTYPE html>
<script src="https://cdn.jsdelivr.net/npm/skapi-js@latest/dist/skapi.js"></script>
<script>
    const skapi = new Skapi('service_id', 'owner_id');
</script>

<form onsubmit='skapi.mock(event).then(ping=>alert(ping.msg))'>
    <input name='msg' placeholder='Test message'>
    <input type='submit' value='Test Connection'>
</form>

This will send a request to your Skapi service and ping back the response. When the request is resolved, the mock() method will return the response data as a Promise object. The response data will be displayed in an alert box.

For more information, check out our documentation.

Keywords

FAQs

Package last updated on 20 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc