skapi-js 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -15
- package/dist/skapi.browser.mjs +26 -18
- package/dist/skapi.browser.mjs.map +1 -1
- package/dist/skapi.cjs +25 -18
- package/dist/skapi.cjs.map +1 -1
- package/dist/skapi.d.mts +236 -70
- package/dist/skapi.d.ts +236 -70
- package/dist/skapi.js +26 -18
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.mjs +25 -18
- package/dist/skapi.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,11 +34,11 @@ Skapi provides all the backend features you need for your web application out of
|
|
|
34
34
|
|
|
35
35
|
## Getting Started
|
|
36
36
|
|
|
37
|
-
### 1. Create a
|
|
38
|
-
|
|
39
|
-
1. Signup for an account at [skapi.com](https://www.skapi.com/signup).
|
|
40
|
-
2. Log in and create a new service from the `My Services` page.
|
|
37
|
+
### 1. Create a Project
|
|
41
38
|
|
|
39
|
+
1. Sign up for an account at [skapi.com](https://www.skapi.com/signup).
|
|
40
|
+
2. Log in and click **+ New Project**. Give your project a name, an optional description and a region, and click **Continue**.
|
|
41
|
+
3. Choose a plan and proceed.
|
|
42
42
|
|
|
43
43
|
### 2. Initialize the Skapi library
|
|
44
44
|
|
|
@@ -59,6 +59,8 @@ For vanilla HTML projects, import Skapi in the script tag, and initialize the li
|
|
|
59
59
|
|
|
60
60
|
**Be sure to replace `"<Project ID>"`, angle brackets included, with your actual project ID**
|
|
61
61
|
|
|
62
|
+
If you run code that still has the placeholder, Skapi asks for the Project ID (a prompt in the browser, a question in the terminal in Node.js) and uses your answer until the browser tab is closed or the Node.js process exits.
|
|
63
|
+
|
|
62
64
|
For more information, check out our [documentation](https://docs.skapi.com/introduction/getting-started.html).
|
|
63
65
|
|
|
64
66
|
### For SPA projects:
|
|
@@ -80,16 +82,6 @@ const skapi = new Skapi("<Project ID>");
|
|
|
80
82
|
export { skapi }
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
### TypeScript (React, Vue, etc.)
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
import { Skapi } from 'skapi-js';
|
|
87
|
-
import type { RecordData, DatabaseResponse } from 'skapi-js';
|
|
88
|
-
|
|
89
|
-
const skapi = new Skapi("<Project ID>");
|
|
90
|
-
let databaseRecords: DatabaseResponse<RecordData>;
|
|
91
|
-
```
|
|
92
|
-
|
|
93
85
|
### Node.js (CommonJS)
|
|
94
86
|
|
|
95
87
|
To use Skapi in NodeJS, import the library as shown below:
|
|
@@ -130,7 +122,7 @@ Below is an example of how you can use the `mock()` method in HTML forms.
|
|
|
130
122
|
</form>
|
|
131
123
|
```
|
|
132
124
|
|
|
133
|
-
This will send a request to your Skapi
|
|
125
|
+
This will send a request to your Skapi project and ping back the response.
|
|
134
126
|
When the request is resolved, the `mock()` method will return the response data as a `Promise` object.
|
|
135
127
|
The response data will be displayed in an alert box.
|
|
136
128
|
|