Skip to content

Commit 2ce1cce

Browse files
committed
Fixed issues with cuid
1 parent d7b6be9 commit 2ce1cce

21 files changed

+1093
-1019
lines changed

README.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,13 @@ import grandeur from "grandeur-js";
113113
This will give you access to the global `Grandeur` object, through which you can initialize the SDK and get a reference to your project as shown below
114114

115115
```javascript
116-
// With global Grandeur object,
117-
// you can simply initialize the SDK
118-
// with your API key and get reference
119-
// to your project
116+
// The init the SDK with API key
117+
// and get reference to your project
120118
var project = grandeur.init("API-KEY", "SECRET-KEY");
121119
```
122120

123121
For User Authorization, generate a token from Grandeur Dahsboard and use as shown below.
124122

125123
```js
126124
var response = await project.auth().token("AUTH_TOKEN");
127-
```
128-
129-
To Fetch device information:
130-
131-
```js
132-
var {device} = await devices.device(deviceID).get("");
133-
```
134-
135-
To Set device information:
136-
137-
```js
138-
await project.devices().device(deviceID).data().set("");
139-
```
125+
```

dist/grandeur-cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/grandeur-cjs.js.LICENSE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
* @copyright Chen, Yi-Cyuan 2015-2018
77
* @license MIT
88
*/
9+
10+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */

dist/grandeur-react.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/grandeur-react.js.LICENSE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @license MIT
88
*/
99

10+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11+
1012
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1113

1214
/**

dist/grandeur.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/grandeur.js.LICENSE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
* @license MIT
88
*/
99

10+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11+
1012
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

examples/create-react-app/package-lock.json

Lines changed: 2 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/create-react-app/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import { Grandeur } from "grandeur-js/react";
66
import { BrowserRouter } from "react-router-dom";
77

88
const apiKey = "ApiKey";
9-
const token = "SecretKey";
9+
const secretKey = "SecretKey";
1010

1111
const root = ReactDOM.createRoot(document.getElementById("root"));
1212
root.render(
13-
<Grandeur apiKey={apiKey} secretKey={token}>
13+
<Grandeur apiKey={apiKey} secretKey={secretKey}>
1414
<BrowserRouter>
1515
<App />
1616
</BrowserRouter>

examples/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @file: main.js: Initialize the SDK and get a reference to the project
22

3-
var project = grandeur.init("ApiKey", "SecretKey");
3+
var project = grandeur.init("APIKey", "SecretKey");
44

55
// Device ID
66
var deviceID = "DeviceId";

examples/next/package-lock.json

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/next/pages/_app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { Grandeur } from "grandeur-js/react";
33

44
export default function App({ Component, pageProps }) {
55
const apiKey = "ApiKey";
6-
const token = "SecretKey";
6+
const secretKey = "SecretKey";
77

88
return (
9-
<Grandeur apiKey={apiKey} secretKey={token}>
9+
<Grandeur apiKey={apiKey} secretKey={secretKey}>
1010
<Component {...pageProps} />
1111
</Grandeur>
1212
);
File renamed without changes.

examples/node/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import grandeur from "grandeur-js";
2+
3+
const apiKey = "apiKey";
4+
const secretKey = "secretKey";
5+
const token = "token";
6+
7+
// Initialization of the project
8+
var project = grandeur.init(apiKey, secretKey);
9+
10+
var deviceID = "deviceID";
11+
12+
// Authenticating the user via token
13+
var res = await project.auth().token(token);
14+
15+
// Get reference to devices
16+
var devices = project.devices();
17+
18+
// And get data
19+
var res = await devices.device(deviceID).get("");
20+
21+
// Log to console
22+
console.log(res);

0 commit comments

Comments
 (0)