Which package/packages do you use?
Describe the bug
- 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/
- 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:
send-event to be in capabilities list
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
Which package/packages do you use?
@stream-io/video-react-sdk@stream-io/video-react-native-sdk@stream-io/video-clientDescribe the bug
send-eventcall 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/To Reproduce
Steps to reproduce the behavior:
If you for example invoke this custom event
warnUserfor warning users, you need to havesend-eventas a setup grant.And if i filter later in my component:
I do not see
send-eventin capabilities althought the code works and events are being sent and received.Expected behavior
I would expect:
send-eventto be in capabilities listsend-eventcapability would be available onOwnCapabilityobject eg.OwnCapability.SEND_EVENTScreenshots
If applicable, add screenshots to help explain your problem.
Version
"@stream-io/video-react-sdk": "^1.25.0"