2016-12-22 1 views
1

私はgetstreamというドキュメントの手順に従っており、すべて "Retrieving Activities"の手順までうまくいっています。アクティビティを取得すると、getstream.io APIから未定義のエラーが返されます

import stream from 'getstream' // stream-js v3.5.0 
const client = stream.connect(APP_KEY, null, APP_ID, { location: 'eu-west' }); 
const user1 = client.feed('user', '1', READ_ONLY_TOKEN); 

user1.get({ limit:5, offset:5 }) 
    .catch((errorData) => { 
    console.log(errorData); 
    }); 

を実行


は、私がここに試みることができるものの任意の提案を

{ 
    error: undefined, 
    response: { 
     statusCode: 0, 
     request: { 
      uri: { 
       protocol: "https:", 
       slashes: true, 
       auth: null, 
       host: "api.getstream.io", 
       port: null, 
       hostname: "api.getstream.io", 
       hash: null, 
       search: "?limit=5&offset=5&api_key=...secret...&location=unspecified", 
       query: "limit=5&offset=5&api_key=...secret...&location=unspecified", 
       pathname: "/api/v1.0/feed/global/global/", 
       path: "/api/v1.0/feed/global/global/?limit=5&offset=5&api_key=...secret...&location=unspecified", 
       href: "https://api.getstream.io/api/v1.0/feed/global/global/?limit=5&offset=5&api_key=...secret...&location=unspecified" 
      }, 
      method: "GET", 
      headers: { 
       stream - auth - type: "jwt", 
       Authorization: "...secret...", 
       ["X-Stream-Client"]: "stream-javascript-client-browser-unknown", 
       accept: "application/json" 
      } 
     } 
    } 
} 

を与えますか?

+0

使用しているSDKを指定できますか? GETリクエストであなたの鍵と秘密を渡すことは、私たちのSDKがどのように動作し、あなたの信任状を公開するかではありません。通常、私たちのstream-jsライブラリでは、このようにデータを接続したり引っ張ったりします:https://github.com/GetStream/stream-js#usage – iandouglas

+0

実行しているストリーム-jsのバージョンを意味しますか? 3.5.0。質問をより詳細で更新しました。私はすでに正しい方法でgetstreamに接続していると信じています:) @iandouglas – zVictor

+0

コードスニペットとエラーが一致していないようです。フィードオブジェクトがどのように初期化されているか再度確認できますか? –

答えて

0

GetStream/stream-js#99で説明されているバグで、getstream.ioチームによって修正されました。

@JelteF:

私は、問題を見つけました。 Meteorには、 リクエストlibの独自のブラウザフォールバックがあり、withCredentialsのデフォルトが異なります。この は、私が前に述べたリクエストブラウザライブラリを上書きします。 PR#100 は、withCredentialsを明示的に設定することでこれを修正する必要があります。

...

私はあなたがそれが解放されるまで、今のところそこからインストール使用することができ、マスターにそれを吸収合併。

ありがとうございました!

関連する問題