> For the complete documentation index, see [llms.txt](https://docs.zebec.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zebec.io/zebec-near/zebec-near-sdk/normal-stream/initialize-token-stream.md).

# Initialize Token Stream

```typescript
const now = nowInSec();
const streamRate = FungibleTokenAmount.parse("0.0001", 18).toString();
const startTime = (now + 10).toString();
const endTime = (now + 400).toString(); // 5 min
const receiver = "receiverAccountId.testnet";
const canCancel = true;
const canUpdate = true;
const tokenId = "usdc.fakes.testnet";

const streamParams: InitTokenStreamParams = {
   streamRate,
   startTime,
   endTime,
   receiver,
   canCancel,
   canUpdate,
   tokenId,
};

const streamPayload = await client.initTokenStream(streamParams);

const results = await wallet.signAndSendTransactions(streamPayload);

```

For obtaining streamId, you can do in the following way.

```typescript
const receipts = result.receipts_outcome;
if (receipts) {
   const receipt = receipts.find(
   (receipt) => receipt !== undefined && (receipt.outcome as any).executor_id == _contractId,
);
let streamId = "";
if (receipt) {
   const evenLog = receipt.outcome.logs.find((log) => log.includes("Token stream created"));
   if (evenLog) {
	const json = evenLog.substring(11);
	streamId = JSON.parse(json).data.stream_id.toString();
   }
}

```
