<p>To connect to the Testnet with blockfrost-js initialize it like this:</p>
<pre><code>const API = new BlockFrostAPI({
  projectId: 'YOURAPIKEYFORTESTNET',
  isTestnet: true
});
</code></pre>

CC BY-SA 4.0
2021-11-28T12:58:45.570Z
2021-11-28T12:58:45.570Z
rx2347
<p>I am getting an error connecting to the Blockfrost API with blockfrost-js</p>
<blockquote>
<p>&quot;Network token mismatch. Are you using token for the correct network?
See <a href="https://docs.blockfrost.io/#section/Available-networks.%22" rel="nofollow noreferrer">https://docs.blockfrost.io/#section/Available-networks.&quot;</a></p>
</blockquote>
<p>I went to blockfrost.io and requested a API key for the testnet, but I still have this error. What to do?</p>

<blockfrost>
How to connect to Testnet on Blockfrost API with blockfrost-js
# How to connect to Testnet on Blockfrost API with blockfrost-js

(Asked by: username_0 on 2021-11-28)

I am getting an error connecting to the Blockfrost API with blockfrost-js

> "Network token mismatch. Are you using token for the correct network?
> See [https://docs.blockfrost.io/#section/Available-networks."](https://docs.blockfrost.io/#section/Available-networks.%22)

I went to blockfrost.io and requested a API key for the testnet, but I still have this error. What to do?

**Tags:** blockfrost

---

## 1 answers

### Answer by username_0 on 2021-11-28. Score: 1 | Accepted answer

To connect to the Testnet with blockfrost-js initialize it like this:
const API = new BlockFrostAPI({
  projectId: 'YOURAPIKEYFORTESTNET',
  isTestnet: true
});


---

