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"
}
}
}
}
を与えますか?
使用しているSDKを指定できますか? GETリクエストであなたの鍵と秘密を渡すことは、私たちのSDKがどのように動作し、あなたの信任状を公開するかではありません。通常、私たちのstream-jsライブラリでは、このようにデータを接続したり引っ張ったりします:https://github.com/GetStream/stream-js#usage – iandouglas
実行しているストリーム-jsのバージョンを意味しますか? 3.5.0。質問をより詳細で更新しました。私はすでに正しい方法でgetstreamに接続していると信じています:) @iandouglas – zVictor
コードスニペットとエラーが一致していないようです。フィードオブジェクトがどのように初期化されているか再度確認できますか? –