Custom send-event is not being in OwnCapabilities

Open
#1,987 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@oliverlaz is already working on this.

Since Nov 10, 2025.

Assessment

This issue has not been assessed yet.

Description

bug

Which package/packages do you use?

  • @stream-io/video-react-sdk
  • @stream-io/video-react-native-sdk
  • @stream-io/video-client

Describe the bug

  1. When sending custom event I had to setup send-event call type grant, which i did not find documented either in https://getstream.io/video/docs/react/guides/custom-events/ or https://getstream.io/video/docs/react/advanced/events/
  2. But the bug I see is that i do not see this in capabilities on the client, nor there is custom capability that i can check, if user can send custom events

To Reproduce
Steps to reproduce the behavior:

If you for example invoke this custom event warnUser for warning users, you need to have send-event as a setup grant.

import type { Call, UserResponse } from '@stream-io/video-react-sdk';

type WarnUserEvent = {
  type: 'warning';
  warn_by_user: Pick<UserResponse, 'name' | 'id'>;
  user: Pick<UserResponse, 'name' | 'id'>;
};

export const useCallWarning = (call: Call) => {
  const warnUser = (
    issuer: WarnUserEvent['warn_by_user'],
    user: WarnUserEvent['user'],
  ) =>
    call.sendCustomEvent({
      type: 'warning',
      warn_by_user: issuer,
      user,
    } satisfies WarnUserEvent);

  const onWarn = (event: WarnUserEvent) => {
    console.log('onWarn', event);
  };

  const isWarnEvent = (event: Record<string, any>): event is WarnUserEvent =>
    event.type === 'warning';

  return { warnUser, onWarn, isWarnEvent };
};

And if i filter later in my component:

  const { useOwnCapabilities } = useCallStateHooks();
  const capabilities = useOwnCapabilities();
  const canSendCustomEvent = capabilities?.includes('send-event');

I do not see send-event in capabilities althought the code works and events are being sent and received.

Expected behavior
I would expect:

  1. send-event to be in capabilities list
  2. send-event capability would be available on OwnCapability object eg. OwnCapability.SEND_EVENT

Screenshots
If applicable, add screenshots to help explain your problem.

Version

  • SDK version: "@stream-io/video-react-sdk": "^1.25.0"
  • It is a React application with PHP backend
Dominant language
TypeScript
Stars
125
Forks
49
Avg merge
1d 4h
Merged PRs (30d)
82

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GetStream/stream-video-js

All issues in GetStream/stream-video-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.