rnet-utils
v1.0.0
Published
Rnet Utilities — secure token and storage helper library
Maintainers
Readme
Rnet Utils
npm install git+http://192.168.254.81/acomique/RNetUtil.gitimport { RnetCore, RnetStore } from "rnet-utils";RnetCore.init({
secretKey: "my-super-secret-key",
baseURL: "https://auth-server.local",
provider: "legacy_users",
loginName: "tony123",
});3️⃣ Securely store and retrieve data
// Encrypt and store
RnetStore.encode("user", { name: "Tony", role: "admin" });
// Retrieve and decrypt
const user = RnetStore.decode("user");
console.log(user); // { name: "Tony", role: "admin" }4️⃣ Fetch authentication token const token = await RnetCore.getToken(); console.log("Access token:", token);
⚙️ Build Commands
To rebuild the library: npm run build
To package for local installation: npm pack
🧱 TypeScript Support
If you’re using TypeScript (e.g., in a React + TS project), you’ll get auto-complete and IntelliSense from included typings.
import { RnetCore, RnetStore } from "rnet-utils";If you’re using plain JS, it works the same — no setup needed.
🧑💻 Example Integration
import React, { useEffect } from "react";
import { RnetCore, RnetStore } from "rnet-utils";
function App() {
useEffect(() => {
RnetCore.init({
secretKey: "tony123!",
baseURL: "https://auth.myserver.com",
});
RnetStore.encode("hello", "world");
console.log("Decoded:", RnetStore.decode("hello"));
}, []);
return <div>Hello Tony 👋</div>;
}
export default App;🧾 License ISC © Antonio Comique
