4444from pydantic import BaseModel
4545
4646from pipecat .transports .daily .utils import (
47+ DailyMeetingTokenParams ,
48+ DailyMeetingTokenProperties ,
4749 DailyRESTHelper ,
4850 DailyRoomParams ,
4951 DailyRoomProperties ,
@@ -84,6 +86,7 @@ async def configure(
8486 sip_num_endpoints : Optional [int ] = 1 ,
8587 sip_codecs : Optional [Dict [str , List [str ]]] = None ,
8688 room_properties : Optional [DailyRoomProperties ] = None ,
89+ token_properties : Optional ["DailyMeetingTokenProperties" ] = None ,
8790) -> DailyRoomConfig :
8891 """Configure Daily room URL and token with optional SIP capabilities.
8992
@@ -106,6 +109,9 @@ async def configure(
106109 individual parameters. When provided, this overrides room_exp_duration and
107110 SIP-related parameters. If not provided, properties are built from the
108111 individual parameters as before.
112+ token_properties: Optional DailyMeetingTokenProperties to customize the meeting
113+ token. When provided, these properties are passed to the token creation API.
114+ Note that room_name, exp, and is_owner will be set automatically.
109115
110116 Returns:
111117 DailyRoomConfig: Object with room_url, token, and optional sip_endpoint.
@@ -179,7 +185,10 @@ async def configure(
179185
180186 # Create token and return standard format
181187 expiry_time : float = token_exp_duration * 60 * 60
182- token = await daily_rest_helper .get_token (room_url , expiry_time )
188+ token_params = None
189+ if token_properties :
190+ token_params = DailyMeetingTokenParams (properties = token_properties )
191+ token = await daily_rest_helper .get_token (room_url , expiry_time , params = token_params )
183192 return DailyRoomConfig (room_url = room_url , token = token )
184193
185194 # Create a new room
@@ -221,7 +230,12 @@ async def configure(
221230
222231 # Create meeting token
223232 token_expiry_seconds = token_exp_duration * 60 * 60
224- token = await daily_rest_helper .get_token (room_url , token_expiry_seconds )
233+ token_params = None
234+ if token_properties :
235+ token_params = DailyMeetingTokenParams (properties = token_properties )
236+ token = await daily_rest_helper .get_token (
237+ room_url , token_expiry_seconds , params = token_params
238+ )
225239
226240 if sip_enabled :
227241 # Return SIP configuration object
0 commit comments