strip html from description
This commit is contained in:
+12
-1
@@ -93,12 +93,23 @@ You can pass an object with several options to a newly created instance of NDK.
|
||||
// Import the package
|
||||
import NDK from "@nostr-dev-kit/ndk";
|
||||
|
||||
/ Create a new NDK instance with explicit relays
|
||||
// Create a new NDK instance with explicit relays
|
||||
const ndk = new NDK({
|
||||
explicitRelayUrls: ["wss://a.relay", "wss://another.relay"],
|
||||
});
|
||||
```
|
||||
|
||||
If the signer implements the `getRelays()` method, NDK will use the relays returned by that method as the explicit relays.
|
||||
|
||||
```ts
|
||||
// Import the package
|
||||
import NDK, { NDKNip07Signer } from "@nostr-dev-kit/ndk";
|
||||
|
||||
// Create a new NDK instance with just a signer (provided the signer implements the getRelays() method)
|
||||
const nip07signer = new NDKNip07Signer();
|
||||
const ndk = new NDK({ signer: nip07signer });
|
||||
```
|
||||
|
||||
Note: In normal client use, it's best practice to instantiate NDK as a singleton class. [See more below](#architecture-decisions--suggestions).
|
||||
|
||||
## Connecting
|
||||
|
||||
Reference in New Issue
Block a user