title: Native API not available in web runtime. Hyperledger Composer
body: <p>To get the complete log of a particular participant. I was following the instruction from this <a href="https://stackoverflow.com/a/51820465/9790416">answer</a></p>
  
  <p>and below is the code. It is throwing an error in Composer Playground as <strong>Native API not available in web runtime</strong>  </p>
  
  <pre><code>async function participantHistory(tx) {
  
      const partId = tx.tradeid;
      const nativeSupport = tx.nativeSupport;
      // const partRegistry = await getParticipantRegistry('org.example.trading.Trader')
  
      const nativeKey = getNativeAPI().createCompositeKey('Asset:org.example.trading.Trader', [partId]);
      const iterator = await getNativeAPI().getHistoryForKey(nativeKey);
      let results = [];
      let res = {done : false};
      while (!res.done) {
          res = await iterator.next();
  
          if (res &amp;&amp; res.value &amp;&amp; res.value.value) {
              let val = res.value.value.toString('utf8');
              if (val.length &gt; 0) {
                 console.log("@debug val is  " + val );
                 results.push(JSON.parse(val));
              }
          }
          if (res &amp;&amp; res.done) {
              try {
                  iterator.close();
              }
              catch (err) {
              }
          }
      }
      var newArray = [];
      for (const item of results) {
              newArray.push(getSerializer().fromJSON(item));
      }
      console.log("@debug the results to be returned are as follows: ");
  
      return newArray; // returns something to my NodeJS client (called via REST API)
  }
  </code></pre>
  
  <p>It is mentioned in the documentation too <a href="https://hyperledger.github.io/composer/latest/reference/js_scripts" rel="nofollow noreferrer">Calling Hyperledger Fabric APIs in transaction processor functions</a></p>
  
  <p>Please help how to use this getNativeAPI.</p>