@bluxcc/core 0.2.17 → 0.3.0

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 CHANGED
@@ -1,26 +1,44 @@
1
- # Blux Wallet Kit - The Missing Piece for Stellar dApps
1
+ # Blux Core: Authentication & Wallet Infrastructure for Stellar dApps
2
2
 
3
- ![image](https://blux.cc/bluxIntro.jpg)
3
+ ![Blux](https://blux.cc/bluxIntro.jpg)
4
4
 
5
- Blux is a **comprehensive authentication and wallet connect kit** designed for Stellar dApps.
6
- It simplifies onboarding by integrating multiple authentication methods, including **wallets, email, passkey, and socials**.
5
+ Blux Core is a JavaScript/TypeScript SDK for adding authentication, Stellar wallet connections, transaction signing, and Soroban interactions to web applications. Users can onboard through supported Stellar wallets, email, passkeys, and social login, while developers get a consistent API and customizable authentication experience.
6
+
7
+ ## Useful Links
8
+
9
+ * **Website:** [blux.cc](https://blux.cc/)
10
+ * **Documentation:** [docs.blux.cc](https://docs.blux.cc/)
11
+ * **Live Demo:** [demo.blux.cc](https://demo.blux.cc/)
12
+ * **Dashboard:** [dashboard.blux.cc](https://dashboard.blux.cc/)
7
13
 
8
14
  ## Features
9
15
 
10
- - **Multi-Wallet Support**: Easily integrate Stellar wallets such as **Rabet, xBull, Lobstr, Freighter, Albedo, Hot Wallet, Hana Wallet, and more**.
11
- - **Social Login** _(Coming Soon)_: Support for **Apple, Meta, Google, and more**.
12
- - **Email & Passkey** _(Coming Soon)_: Securely onboard users with non-crypto credentials.
13
- - **Customizable UI**: Adjust themes, fonts, backgrounds, logos, border radius, and text colors.
14
- - **Configurable Networks**: Set up and modify network preferences via API keys.
15
- - **Future-Proof**: More wallets and authentication methods will be added based on community feedback.
16
+ * **Framework-Agnostic**: Use Blux Core with vanilla JavaScript, TypeScript, or any frontend framework.
17
+ * **Multi-Wallet Support**: Integrate Stellar wallets such as **Rabet, xBull, LOBSTR, Freighter, Albedo, HOT Wallet, Hana, and more**.
18
+ * **Email, Passkey & Social Authentication**: Onboard users without requiring them to install or manage a traditional wallet.
19
+ * **Transaction Signing**: Connect wallets and request transaction signatures through a consistent interface.
20
+ * **Soroban Support**: Add Stellar smart contract interactions to your application.
21
+ * **Customizable UI**: Adjust themes, fonts, backgrounds, logos, border radius, text colors, and other interface elements.
22
+ * **Wallet Configuration**: Include or exclude individual wallets and control their display order.
23
+ * **Configurable Networks**: Choose the Stellar networks supported by your application and set a default network.
24
+ * **Custom Explorer**: Configure the block explorer used for account and transaction links.
25
+ * **Localization**: Provide the authentication experience in multiple supported languages.
26
+ * **User Management & Analytics**: Review authentication methods, login activity, timestamps, and associated wallet addresses through the Blux dashboard.
27
+ * **Testing Tools**: Use predefined test accounts and reusable OTP credentials in configured testing environments.
28
+ * **Multiple Projects**: Create and manage multiple applications from a single Blux account.
29
+ * **Future-Proof**: More wallets and authentication methods will be added based on community feedback.
16
30
 
17
31
  ## Installation
18
32
 
33
+ Install Blux Core through npm:
34
+
19
35
  ```sh
20
36
  npm i @bluxcc/core
21
37
  ```
22
38
 
23
- ## Usage
39
+ Blux Core can also be loaded directly in the browser through a CDN.
40
+
41
+ ## Browser Usage
24
42
 
25
43
  ```html
26
44
  <!DOCTYPE html>
@@ -41,6 +59,8 @@ npm i @bluxcc/core
41
59
  </script>
42
60
  ```
43
61
 
62
+ ## JavaScript and TypeScript Usage
63
+
44
64
  ```tsx
45
65
  import { blux, core, createConfig } from '@bluxcc/core';
46
66
 
@@ -55,11 +75,106 @@ document.getElementById('loginBtn').onclick = async () => {
55
75
  };
56
76
  ```
57
77
 
78
+ Create a project through the [Blux Dashboard](https://dashboard.blux.cc/) to obtain your application ID. You can create and manage multiple projects from the same account.
79
+
80
+ ## Customization
81
+
82
+ Developers can customize various UI elements:
83
+
84
+ * **Themes & Fonts**
85
+ * **Backgrounds, Logos**
86
+ * **Border Radius & Text Colors**
87
+ * **Authentication Limits** (Free tier supports 500-1000 accounts per auth method)
88
+
89
+ Developers can also configure:
90
+
91
+ * Enabled authentication methods
92
+ * Included and excluded wallets
93
+ * Wallet display order
94
+ * Supported networks
95
+ * Default network
96
+ * Block explorer
97
+ * Interface language
98
+
99
+ Configuration options can be set via the `BluxProvider` config or environment variables.
100
+
101
+ ## Dashboard & User Analytics
102
+
103
+ The Blux dashboard provides information about the users who have connected to your application.
104
+
105
+ Available information includes:
106
+
107
+ * Authentication method
108
+ * Login and connection timestamps
109
+ * Associated wallet addresses, when available
110
+ * Recent authentication activity
111
+ * Individual user information
112
+
113
+ This information can help developers understand how their applications are being used and troubleshoot authentication or wallet connection issues.
114
+
115
+ ## Development & Testing
116
+
117
+ Blux provides predefined accounts for development and quality assurance.
118
+
119
+ Developers can use preset email identities together with a reusable testing OTP. This makes it possible to test the complete login process repeatedly without waiting for real email delivery or using personal user information.
120
+
121
+ These credentials are intended only for the configured testing environment. Refer to the [Blux documentation](https://docs.blux.cc/) for the current testing credentials and setup instructions.
122
+
123
+ ## Supported Wallets
124
+
125
+ Currently supported connection methods:
126
+
127
+ * [x] **Freighter**
128
+ * [x] **Rabet**
129
+ * [x] **WalletConnect**
130
+ * [x] **HOT Wallet**
131
+ * [x] **Hana**
132
+ * [x] **xBull**
133
+ * [x] **LOBSTR**
134
+ * [x] **Ledger**
135
+ * [x] **Albedo**
136
+ * [x] **Klever Wallet**
137
+ * [x] **Bitget Wallet**
138
+ * [x] **OneKey**
139
+ * [x] **CactusLink**
140
+ * [x] **Fordefi**
141
+ * [x] **Trezor**
142
+ * [x] **Email**
143
+ * [x] **Google**
144
+ * [x] **Passkey**
145
+
146
+ ## Supported Languages
147
+
148
+ Currently supported languages:
149
+
150
+ * [x] **English**
151
+ * [x] **Spanish**
152
+ * [x] **Portuguese**
153
+ * [x] **French**
154
+ * [x] **German**
155
+ * [x] **Russian**
156
+ * [x] **Chinese**
157
+ * [x] **Japanese**
158
+ * [x] **Korean**
159
+
160
+ ## License & Usage Restrictions
161
+
162
+ * **No Forking or Unauthorized Modifications**: Removing references to **Blux Team** or forking without attribution is strictly prohibited.
163
+ * **Custom Licensing Available**: Contact us at [support@blux.cc](mailto:support@blux.cc) to discuss licensing options.
164
+
58
165
  ## Support & Contact
59
166
 
60
- For support, licensing, or inquiries, reach out via:
167
+ For support, licensing, custom SMS authentication, or other inquiries, reach out via:
168
+
169
+ * **Email**: [support@blux.cc](mailto:support@blux.cc)
170
+ * **X**: [@BluxOfficial](https://x.com/bluxofficial)
171
+
172
+ ## Roadmap & Future Plans
61
173
 
62
- - **Email**: [support@blux.cc](mailto:support@blux.cc)
63
- - **X (Twitter)**: [@BluxOfficial](https://twitter.com/BluxOfficial)
174
+ Blux is evolving. Follow our updates on [X](https://x.com/BluxOfficial) for:
64
175
 
65
- Follow for more updates at [X (Twitter)](https://twitter.com/BluxOfficial).
176
+ * **Additional OAuth and Social Authentication Methods**
177
+ * **More Wallet Integrations**
178
+ * **Enhanced Developer Hooks**
179
+ * **Expanded Soroban Support**
180
+ * **Enhanced Customization, Analytics, and Security Features**
@@ -7,6 +7,9 @@ interface ModalProps {
7
7
  children: React.ReactNode;
8
8
  appearance: IAppearance;
9
9
  isPersistent: boolean;
10
+ isBodyMount: boolean;
11
+ /** Parent passed to createConfig. Used to pin horizontal placement. */
12
+ mountElement?: HTMLElement;
10
13
  }
11
- declare const Modal: ({ isOpen, onClose, children, isSticky, appearance, isPersistent, }: ModalProps) => React.ReactPortal | null;
14
+ declare const Modal: ({ isOpen, onClose, children, isSticky, appearance, isPersistent, isBodyMount, mountElement, }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
12
15
  export default Modal;
@@ -1 +1,4 @@
1
- export declare const Provider: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const Provider: ({ isBodyMount, mountElement, }: {
2
+ isBodyMount: boolean;
3
+ mountElement?: HTMLElement;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -39,13 +39,10 @@ export declare const sendTransaction: (xdr: string, options?: {
39
39
  * Signs an arbitrary message with the connected wallet.
40
40
  *
41
41
  * @param message - The message to sign.
42
- * @param options - Optional network passphrase override.
43
42
  * @returns The signature.
44
43
  * @throws If the user is not authenticated or the Blux modal is open elsewhere.
45
44
  */
46
- export declare const signMessage: (message: string, options?: {
47
- network: string;
48
- }) => Promise<unknown>;
45
+ export declare const signMessage: (message: string) => Promise<unknown>;
49
46
  /**
50
47
  * Signs a Soroban authorization entry with the connected wallet.
51
48
  *
@@ -66,9 +63,7 @@ export declare const blux: {
66
63
  logout: () => void;
67
64
  fundMe: () => void;
68
65
  profile: () => void;
69
- signMessage: (message: string, options?: {
70
- network: string;
71
- }) => Promise<unknown>;
66
+ signMessage: (message: string) => Promise<unknown>;
72
67
  signAuthEntry: (authEntry: string, options?: {
73
68
  network: string;
74
69
  }) => Promise<unknown>;
@@ -78,7 +73,8 @@ export declare const blux: {
78
73
  sendTransaction: (xdr: string, options?: {
79
74
  network: string;
80
75
  }) => Promise<unknown>;
81
- /** Whether the SDK has finished initializing and is ready to use. */
76
+ /** Whether the SDK has finished initializing and is ready to use. Wallet
77
+ * availability is not part of this wait when `loginMethods` omits `'wallet'`. */
82
78
  readonly isReady: boolean;
83
79
  /** Whether a user is currently authenticated. */
84
80
  readonly isAuthenticated: boolean;
@@ -1,12 +1,19 @@
1
1
  import { IConfig } from '../types';
2
- import '../tailwind.css';
2
+ export type { IAppearance, IConfig, IExplorer, ILoginMethods, IServers, ITrezorMetaData, ITransports, IWalletConnectMetaData, IWalletNames, LanguageKey, } from '../types';
3
3
  /**
4
4
  * Initializes the Blux SDK: validates the config, mounts the Blux UI, loads
5
5
  * available wallets, wires up integrations (WalletConnect, Trezor), and
6
6
  * authenticates the app id. Call this once before any other Blux function.
7
7
  *
8
+ * Wallet availability is always scanned in the background. `isReady` waits on
9
+ * that scan only when `loginMethods` includes `'wallet'`; apps that omit
10
+ * wallet login (email/social/passkey only) become ready as soon as the config
11
+ * is applied, so they are not blocked by extension detection or `window.load`.
12
+ *
8
13
  * @param config - The app configuration — see {@link IConfig}.
9
14
  * @param element - DOM element to mount the Blux UI into. Defaults to `document.body`.
15
+ * When set, the modal is centered horizontally in this element and vertically
16
+ * in the viewport, so a sidebar layout can offset it without it scrolling away.
10
17
  * @throws If `config` is empty or missing `appId`, `appName`, or `networks`, or if the network options are invalid.
11
18
  */
12
19
  export declare function createConfig(config: IConfig, element?: HTMLElement): void;
@@ -1,4 +1,7 @@
1
1
  import { BluxEventMap, ReadOnlyEmitter } from '../utils/events';
2
+ export type { IAppearance, IConfig, IExplorer, ILoginMethods, IServers, ISocialProvider, ITrezorMetaData, ITransports, IWalletConnectMetaData, IWalletNames, LanguageKey, } from '../types';
3
+ export type { IUser } from '../store';
4
+ export type { IExportedStore } from './exportedStore';
2
5
  export { Asset } from '@stellar/stellar-sdk';
3
6
  export * as StellarSdk from '@stellar/stellar-sdk';
4
7
  export * from './core';